Buy stocks after a sharp drop, wait for a rebound, and stay out when the market looks weak. It sounds like a trading plan—but how do you define a sharp drop, a rebound, or a weak market?
In this video, we turn those decisions into precise rules and build a stock-picking strategy step by step in AlgoCloud. Then we test how two filters change its performance across roughly 30 years of historical data.
From intuition to testable rules
The starting idea is simple: look for S&P 500 stocks that have fallen more than 5% over three trading days. When several stocks qualify, rank them by the size of the decline and prioritize the largest drops, holding a maximum of 10 long positions.
The exit also needs a clear definition. Close a position when the daily closing price exceeds the previous day’s high, or after 10 days if that exit signal has not occurred.
These rules give AlgoCloud a repeatable process to apply across the stock universe. They also make it possible to examine the strategy’s historical returns and drawdowns before taking it further.
What two filters changed
The initial backtest produced a rising equity curve, but its maximum drawdown reached approximately 67%. The video then tests two additions without changing the original entry condition:
- A stock trend filter: Only buy stocks trading above their 200-day moving average. Maximum drawdown fell to around 35%, with an annual return of approximately 19%.
- A market regime filter: Also require SPY to be above its 200-day moving average. Annual return decreased to approximately 14%, while maximum drawdown fell further to around 26%.
The comparison shows why entry rules are only part of a strategy. Defining when to trade—and when to wait—can substantially change its historical risk and return.