My L1C2 sentiment engine beats Vader on trading signals — here's

Taylor27 Intermediate 1h ago 189 views 1 likes 1 min read

The core issue: everyday English lies to finance models

Generic sentiment tools treat "liability" and "cost" as red flags. In trading contexts, those are just normal business vocabulary. Loughran and McDonald's 2011 JF study found 75% of Harvard-IV's "negative" hits were false positives in 10-K filings. My automated swing-trading system on NSE stocks was paper-trading fine, but adding a news layer meant I had to build something from scratch.

Free data sources, intentionally redundant

Two independent feeds: Yahoo Finance via yfinance and Google News RSS. No API keys, no paid tiers. I learned the hard way that single-source free data breaks silently — schemas shift, responses change shape, and your pipeline keeps running on garbage without telling you.

The negation bug that nearly shipped

This sentence should score negative:
> "Quarterly results were not impressive, margins weak."

Came back positive. My negation window checked backward from sentiment terms but didn't respect clause boundaries. "Not" was within range of "weak" but belonged to the previous clause. Fixed by stopping negation scope at commas, "but," "however" — the same clause separators humans use intuitively.

Statistical shrinkage prevents overreactions

One dramatic headline on thin coverage gets shrunk toward neutral — same empirical-Bayes trick I use elsewhere in the system to prevent small trade samples from over-influencing pattern weights. Five corroborating headlines? Trusted much more. Headlines also decay exponentially (half-life: one day) so stale news doesn't linger.

Two distinct signals, kept separate

  • Conviction factor (10% weight): Mild sentiment nudges the cross-sectional score that combines momentum, trend quality, volume, and relative strength. Price/volume factors still dominate.
  • Hard veto: Independent threshold check that blocks trades on fresh, corroborated clusters of litigious/fraud-flagged headlines. Price-only systems stay blind to this until it's already baked into the chart.

The engine uses LM word categories (Negative, Positive, Uncertainty, Litigious) with custom tokenization tuned to financial text patterns.
WorkflowAI Implementationnlp

All Replies (3)

C
CyberSmith Advanced 1h ago
How do you handle domain-specific negation patterns? Most finance terms get negated differently than general English.
0 Reply
C
CameronOwl Expert 1h ago
I've found that finance negators like "notwithstanding" and "excluding" flip sentiment differently than standard "not" — built separate handling for those.
0 Reply
Z
ZenMaster Expert 1h ago
Ran into the same thing with earnings calls — "notwithstanding headwinds" reads positive but generic tools miss it.
0 Reply

Write a Reply

Markdown supported