Strategy pattern · Trend
Test a moving average trend filter before you trust the backtest.
Super Algo Kit grades the moving average trend filter strategy B: stay in a market above its long average, exit below it. A common choice is the 200-day average. Its main documented benefit is smaller drawdowns, and results are contested once data snooping and costs are counted. The kit tests your version with costs and deflated statistics before a paper run.
strategy facts
Moving-average trend filter with volatility stop
- Family
- Trend, from published literature
- Markets
- Futures, equities, crypto spot and forex
- Timeframes
- Hourly and daily bars; decisions on completed daily closes
- Evidence grade
- B: long histories behind it, but disputed once data snooping and costs are counted; mainly shallower drawdowns
- Status
- Literature: described in published research, not yet tested by the kit
- Data needed
- Daily closes, ATR history, session and holiday calendars, costs, and roll rules for futures
- Kit note
- The most common first strategy people bring; the kit's own worked example uses this card
From the kit's own card. Not investment advice.
Paper first
Test it before you trade it.
Super Algo Kit runs inside the coding agent you already use. It interviews you, writes the spec with pass marks set first, then builds, backtests and paper-tests. Real money starts only when you type the authorize command.
The plan, step by step
Tick them off as you go.
How does a moving average trend filter work?
The filter bets that trends persist. Deep sell-offs have mostly happened while price sat under a falling long-term average, so being out of the market there sidesteps some of the damage.
Research on simple average rules over long index histories, and on monthly timing across asset classes, points mainly to shallower drawdowns. These rules are also highly exposed to data snooping, where many variants are tried and the winner is kept.
Moving average strategy rules in plain words
This is a summary of the card, not its full rules. Every look-back and stop multiple you try is logged as a trial.
- Compare the completed daily close with a long simple average, such as 200 days or 10 months.
- Buy at the following session's open once a day closes above the average.
- Sell at the following open once a day closes below it, or flip short if you declared that.
- Keep a stop at the venue, set a multiple of average true range below entry and trailed on closes.
What the evidence says about moving average rules
Brock, Lakonishok and LeBaron (1992) tested simple moving-average rules on a long index history. Faber (2007) studied a monthly timing rule across asset classes, and Sullivan, Timmermann and White (1999) tested such rules for data-snooping bias.
The kit's card adds a warning. With 36 settings tried over 16 years, luck alone can show an annualised Sharpe near 0.5. A pass therefore rests on the deflated Sharpe rather than the raw figure.
How Super Algo Kit tests a trend filter bot before any money
Pass marks go into the spec before the first run, and they are not edited later without a recorded decision. The backtest includes the market pack's costs and, for futures, its roll rules.
Walk-forward validation checks that neighbouring look-backs behave alike, so one lucky setting cannot pass. Results are also split into trend and range regimes.
Before you rely on it
Where it fails.
- Whipsaw: in sideways markets each crossing of the average costs a round trip.
- V-shaped reversals: it sells near the low and buys back higher.
- Lag: in fast crashes, and on gaps above all, the exit comes late.
- Hourly versions trade much more, adding noise and cost.
- Look-back shopping: testing many averages and keeping whichever looked strongest.
FAQ
Moving-average trend filter: questions.
Does the 200-day moving average strategy work?
Super Algo Kit does not promise that it does. The kit grades the moving average trend filter B: it has long histories behind it, but is disputed once data snooping and costs are counted. Its main documented benefit is smaller drawdowns.
Why do moving average strategies whipsaw?
In range-bound markets price keeps crossing the average, and each crossing costs a full round trip. Hourly versions cross far more often, so costs and noise grow. Super Algo Kit splits test results into trend and range regimes so you see this before paper trading.
How many moving averages should I test?
As few as you can, because every one counts as a trial. The kit's card notes that 36 settings over 16 years can show an annualised Sharpe near 0.5 from luck alone. That is why Super Algo Kit judges the deflated Sharpe and checks neighbouring look-backs.
Can Super Algo Kit build a moving average trading bot?
Yes. Super Algo Kit adds specialist roles to your own AI coding agent, which writes the bot as real code in your project. It interviews you, writes a spec with pass marks, backtests with costs and runs a paper test first. Live starts only when you type the authorize command.
Keep reading
More guides.
Sources the kit's card cites
- Faber (2007). A Quantitative Approach to Tactical Asset Allocation. Journal of Wealth Management.
- Brock, Lakonishok and LeBaron (1992). Simple Technical Trading Rules and the Stochastic Properties of Stock Returns. Journal of Finance.
- Sullivan, Timmermann and White (1999). Data-Snooping, Technical Trading Rule Performance, and the Bootstrap. Journal of Finance.
- Hurst, Ooi and Pedersen (2017). A Century of Evidence on Trend-Following Investing. Journal of Portfolio Management.
Build it with Super Algo Kit.
15 specialist roles and 35 skills inside your coding agent. Paper first, live only when you say.
Super Algo Kit is development software. It is not investment advice, a signal service or a promise of performance. Trading involves substantial risk, including the loss of all capital you trade with.