Momentum divergence
Marks bars where the average of two rate-of-change inputs is above 0.001; despite the name, it detects no divergence.
MomentumDivergence averages its roc_short and roc_medium inputs and is on when that average is above 0.001. The threshold is a 0.1% move only if those inputs are fractional rates of change. Despite the name, it never compares price with momentum or looks at history, so it detects no divergence. It is also on whenever either input has no value yet, and the close and atr inputs do not affect the result.
How to read it
- A marker on a candle means the average of roc_short and roc_medium is above 0.001 on that bar.
- A gap in the markers means that average is at or below 0.001, so momentum is too weak to pass.
- Early bars carry markers until both inputs have values, so the first stretch of the chart reads on.
- If markers cover almost every candle, check the wiring: both inputs must be rate-of-change series, not price.
What it outputs
- Momentum filter on
- On, drawn as a marker, where the average of the two rate-of-change inputs is above 0.001 or either input has no value yet. Off where the average is at or below 0.001.
When it fires
On whenever the average of roc_short and roc_medium is above 0.001, and whenever either input has no value yet, so early bars read on by default. A marker means momentum is positive past the threshold. A gap means it is at or below the threshold.
Settings
- period
- No effect. The period is stored but never read, so raising or lowering it leaves the markers unchanged on every bar.
Pitfalls
- The sample fed the raw close price into both rate-of-change inputs, which have no default. Price is always above 0.001, so the sample shows it on at every bar. That reflects the wiring, not momentum.
- It is not a divergence detector: it never compares price with momentum, so a price high with falling momentum is only caught once the average drops below 0.001.
- The period setting does nothing, the atr input is never read and close is fetched but unused. The indicator is one momentum threshold on two inputs.