LessonThis is a lesson restated in new words. Any figure in it is an example from the source, not this desk's record.
Same-day StockTwits sentiment and same-day returns, joined for a set of large-cap names, did not look like a formless cloud. A crude ranking of the whole history was only weakly encouraging. Ranking inside each day, then averaging those daily buckets, produced a monotone step from low sentiment to high sentiment. A book that went long the top daily quartile and short the bottom had a Sharpe ratio near 2.3 in the lecture, where Sharpe means annualized average return divided by annualized volatility. The lecture says that book used information from the same day as the return, so it was not a tradable strategy as built.
Why it matters
The data come from Financial Modeling Prep’s historical social-sentiment endpoint, paged backward about a year inside a helper the lecture was considering for its qfin package. You supply your own API key. The endpoint is one of many on that service. The lecture also notes that academic access had been narrowed, with enterprise limits, and does not claim this feed replaces every other text source.
The idea in plain words
The score itself is partly opaque. The lecture says it does not know the exact construction, that social sentiment in general skews positive, and that news sentiment skews negative. The series is used as an arbitrary tone measure at a time that might be before the open, during the session, or after. Using anything stamped after 9:00 a.m. to trade the open would look ahead. The lecture sets that problem aside and studies the contemporaneous link on purpose, because it is easier, and says a pre-open version of the relationship had already shown up in their own paper. No statistic from that paper is repeated here.
After the pages are pickled so the pull is not repeated, each frame is averaged by date and symbol. Several hourly rows for one name on one date become one sentiment number. A merge, not a concatenation, attaches the return. The lecture’s distinction: a merge can bring in new columns, while a concatenation keeps the existing column set and stacks rows. The sentiment frame has no prices until the merge.
A scatter of tone against return is not a neat upward line. Near a neutral reading of about 0.5, both positive and negative returns appear. The lecture prefers that pattern to a round Gaussian cloud, which would have meant no separation at all. It also refuses the hope that positive tone must mean a positive return in absolute terms. The comparison they want is relative: buckets inside a day.
A single quartile cut on the pooled history, four bins from the bottom fourth to the top fourth, is what they call a lazy ranking. Averaging returns inside those global bins was only mildly encouraging. Being short the bottom half and long the top half would have been positive if you added the legs, and they say that is still not the shape you want. A real signal, in their words, should be monotone. The pooled cut is also a poor match of distributions across names. They label it a bad way to do the ranking.
How to use it
Keep the tradable question separate from the alignment question. To copy the alignment, average sentiment to the date, merge to a same-day return, rank within the day, and plot the average return by rank. To move toward something you could send to a broker, the lecture’s own next step is pre-market tone, not the same-day average. They do not claim the Sharpe near 2.3 survives that change.
What usually goes wrong
Reporting the Sharpe near 2.3 as a backtest you can trade ignores the lecture’s sentence that the signal is contemporaneous. Same-day tone includes information you may not have had at the decision time. The 9:00 a.m. remark is the concrete version of that leak.
Questions people ask
What Sharpe ratio did the lecture report?
Near 2.3, after annualizing the return and the volatility of a book that was long the top daily quartile and short the bottom. Sharpe here is that ratio of annualized average return to annualized volatility. The book was not tradable as constructed.
Why was the first quartile chart disappointing?
It ranked the entire history at once. The lecture says a long-short of the outer halves would have been positive and still not monotone. Monotone steps showed up when the quartiles were formed each day and then averaged.
What return definition did they merge on?
Close minus open, divided by the open, from yfinance, merged to sentiment that had been averaged by date and symbol. A concatenation would not have added those price columns.