Strategy Lab
Moving Average Cross rules and sample replay
This five-bar study records when a closing price moves to the opposite side of its simple moving average.
Crown Pips · Reviewed
Walkthrough
- Calculate a five-close arithmetic mean for the previous candle, then again for the current candle with its own five-close window.
- Record a long study when the prior close was at or below its average and the new close is above its updated average.
- Record a short study for the mirror condition. A close staying on the same side or sitting exactly on its new average produces WAIT.
Worked example
For closes of 100, 100, 100, 100, 99 and 102, the penultimate close is below 99.8. The last close is above 100.2, producing an upward cross.
Replay the rule
Fictional M15 candles. Each decision uses only bars completed at that point.
- Bar 1 · WAIT · Close 103
Need 6 completed bars including the decision bar.
- Bar 2 · WAIT · Close 101
Need 6 completed bars including the decision bar.
- Bar 3 · WAIT · Close 102
Need 6 completed bars including the decision bar.
- Bar 4 · WAIT · Close 101
Need 6 completed bars including the decision bar.
- Bar 5 · WAIT · Close 100
Need 6 completed bars including the decision bar.
- Bar 6 · WAIT · Close 101
There was no new close across the five-bar average.
- Bar 7 · LONG STUDY · Close 104
The close moved from at or below its average to above it.
- Bar 8 · WAIT · Close 103
There was no new close across the five-bar average.
- Bar 9 · WAIT · Close 104
There was no new close across the five-bar average.
- Bar 10 · SHORT STUDY · Close 100
The close moved from at or above its average to below it.
- Bar 11 · WAIT · Close 102
There was no new close across the five-bar average.
- Bar 12 · LONG STUDY · Close 103
The close moved from at or below its average to above it.
- Bar 13 · WAIT · Close 110
There was no new close across the five-bar average.
- Bar 14 · WAIT · Close 109
There was no new close across the five-bar average.
- Bar 15 · SHORT STUDY · Close 102
The close moved from at or above its average to below it.
- Bar 16 · WAIT · Close 99
There was no new close across the five-bar average.
In the Crown Pips Telegram bot, send /tactics average-cross 7 for this candle.
What to keep in mind
A short moving average can change direction repeatedly in a flat market. The research window of five bars is selected for this walkthrough.
Source & further reading
TradingView · MovingAvg Cross