Mean reversion signal
Marks one-minute closes pushed beyond two standard deviations from their 20-bar average, buy below and sell above.
It takes the average and standard deviation of the close over the last window bars, then draws a band mult standard deviations above and below that average. A buy marker (True) appears when the close is below the lower band, and a sell marker (False) when it is above the upper band; bars inside the bands get no marker. It reads only the close, and no markers appear until a full window of bars exists.
How to read it
- Markers sit on the candles. A bar with no marker closed inside the bands.
- A buy marker means the close is unusually low for its recent average, below the lower band.
- A sell marker means the close is unusually high for its recent average, above the upper band.
- Several markers in a row on one side usually mean price is riding a band in a trend, not reverting.
What it outputs
- Mean reversion signal
- Buy marker where the close is below the lower band, sell marker where it is above the upper band, nothing inside the bands.
When it fires
When the close is outside a band on that bar: a buy marker below the lower band, a sell marker above the upper band. It marks a stretch versus the recent average, not a confirmed bottom or top.
Settings
- window
- Bars the average and spread are taken over. Shorter windows make the bands follow price closely, reacting to short swings. Longer windows give a slower band that stays put through short swings.
- mult
- Standard deviations between the average and each band. Raising it widens the bands, so markers get rarer. Lowering it narrows them. At 0 the bands meet the average and nearly every bar marks; negative values swap the bands and mean nothing.
Pitfalls
- At defaults about 11% of one-minute bars carry a marker, roughly 51 events a day on a month of SPY, so most markers are noise without a trend or volume filter.
- The average and spread include the current bar, so a large spike drags the band toward it and can stop the marker it would otherwise draw.
- In a trend the close can ride one band for many bars, so buy or sell markers repeat; a marker is not a reversal.