Backtesting a Sentiment Threshold Strategy with Event-Driven Data
Summary
The article describes a long-only equity strategy that uses timestamped vendor sentiment scores as trading events in QSTrader. It enters a stock when its sentiment reaches the positive threshold of +6 and exits when the score falls to -1. Three versions apply the same rules to groups of five S&P 500 companies in technology, defence, and energy. The example uses fixed share quantities rather than allocations that scale with portfolio value.
A key implementation issue is synchronizing sentiment records with price events in an event-driven backtest. The article addresses this by adding a sentiment event and handler so dated ticker scores can reach the strategy alongside market data. It uses a sample file covering nearly five years at daily frequency and daily OHLCV prices for the selected stocks, then presents backtests for the period from October 2012 to February 2016. The article emphasizes that vendor scoring methods are proprietary and that its strategy is deliberately simple; it does not establish that the thresholds generalize or that results survive alternative sizing, shorting, costs, or out-of-sample evaluation.
Key ideas
- The strategy buys a stock at a sentiment score of +6 and closes it at -1.
- Sentiment records must be synchronized with price events in the event-driven backtest.
- The examples apply the same rules to five-stock groups in technology, defence, and energy.
- Each position uses a fixed share quantity, so exposure does not adjust dynamically with account size.
- Vendor sentiment scoring is proprietary, and the simple historical examples do not establish general performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.