@QuantifiedStrat This strategy is ineffective as it fails to account for SPY’s quarterly dividend distributions. Its performance advantage virtually disappears after incorporating dividend income.
@ConcretumR There are a few other issues as well. But those first three alone are enough to make this strategy completely worthless. I should’ve checked right away whether dividends were considered in the code—then I wouldn’t have wasted half a day trying to fix your code.
@ConcretumR from real-world outcomes.
On days when multiple signals are generated, the available buying power changes between consecutive signals. But you kept using the same buying power throughout, which again makes the strategy deviate significantly from actual values.
@ConcretumR , your strategy underperforms versus just buying and holding SPY most of the time.
You used the opening price to calculate how many shares the available cash could buy, instead of using the price at the time the signal was triggered. This causes the strategy’s results to deviate
@ConcretumR Thanks for sharing, but there are a few issues with your code and strategy:
When you calculated the long-term "buy and hold" strategy for SPY, you didn’t account for dividends. That’s a pretty serious mistake. If you only compare during periods where no dividends were issued