Explosive reversal
Marks bars where an oversold RSI reading meets a volume spike, with no check on price direction.
ExplosiveReversal marks a bar when the RSI input is below -0.3 and volume is above 1.5 times its recent average, or when the RSI input is below -0.2 and volume is above 2 times that average. The average covers the last volume_window bars and includes the current bar. The name suggests a reversal, but the code only tests oversold RSI and volume and never looks at which way price moved.
How to read it
- Markers sit on candles where the rule fires; every other candle stays blank.
- Each marker means heavy volume arrived while the RSI input read strongly oversold. It does not show whether price then turned up.
- Feed it a -1 to +1 balance such as basic.RSI. A price, or a 0 to 100 RSI, never drops below the -0.3 cut, so no markers appear.
- The first volume_window bars show nothing while the volume average fills.
What it outputs
- Oversold volume spike
- True on bars where the RSI input is oversold and volume spikes above its recent average. Blank on every other bar.
When it fires
Fires on a bar with RSI below -0.3 and volume above 1.5 times its recent average, or RSI below -0.2 and volume above 2 times. Read it as heavy volume arriving at a strongly oversold RSI input. On the default SPY sample it never fired: that run wired the close price in as the RSI input.
Settings
- rsi_window
- No effect. The indicator keeps this value but never reads it, so moving it does not change the chart. The RSI length comes from whatever indicator is wired into rsi_pipe.
- volume_window
- Bars in the volume average a spike is measured against, including the current bar. Raising it eases the spike test slightly and delays the first marker. Lowering it makes the spike test much stricter.
Pitfalls
- Zero markers on the default SPY sample is a wiring artifact: the explainer run fed the close price into rsi_pipe, which never falls below -0.3. Judge it only with a -1 to +1 RSI.
- Price direction is not checked, so a high-volume bar that keeps falling passes the same as one that turns up. The docstring's overbought side is also missing: only oversold is tested.
- The current bar counts in its own average, so at 10 bars a spike needs about 1.6 times the prior bars' average, not 1.5, and about 2.25 times, not 2.