Dual moving-average crossover
TrendBeginner
A short moving average crossing a longer one is a standard way to follow a trend without predicting the next bar. Traders treat a short average closing above a long average as a possible uptrend, and the reverse cross as a reason to exit or flip. The averages are slow on purpose: price has to stay higher or lower long enough to move them.
Not investment advice. Nothing here is a recommendation to buy or sell anything. Backtests and historical studies are not guarantees, and a rule that worked in one sample can fail in the next. Trading can lose money. Links are for education, not endorsements. Do your own research.
- Rules
- Widely published pairs include 50 and 200 periods, often called a golden cross and a death cross, and faster pairs such as 10 and 30. Go long when the shorter average closes above the longer one, and flat or short when it closes back below. A stop, often an ATR multiple, keeps one noisy cross from reversing the whole position.
- Where AI fits
- An LLM can turn the rule into a backtest in Python or Pine Script and include commissions and slippage. Searching window lengths is only useful with a walk-forward or holdout split, because the best pair on one history is often noise. A second model can turn the crossover off when a range detector says the market is not trending.
- Markets
- Liquid stocks, equity index futures, FX majors, and commodities.
- Timeframes
- Daily bars for 50/200. Intraday only with faster windows and realistic costs.
- Risks
- Crossovers lag, so entries come after a move has started and exits come after it has ended. Sideways markets produce repeated whipsaws. Fitting the two window lengths to one chart overfits easily.