Trading Price-Indicator Divergences with Normalization and ATR Exits
Summary
This strategy detects regular and hidden bullish or bearish divergences between price pivots and a configurable indicator source. Users can choose pivot-based detection or an immediate method, set pivot lookback and lookahead, and optionally normalize the indicator with rolling min-max scaling, a rolling z-score, or robust scaling. Divergence signals can be enabled separately for trading, and the strategy supports configurable stop and target distances based on either ATR or percentages.
The script also tracks trade outcomes and draws target, stop, and exit annotations. Its exit logic uses lower-timeframe data to resolve bars where both stop and target might be reached, an attempt to address intrabar ambiguity. However, the supplied excerpt is incomplete and includes no performance report or independent validation. Pivot confirmation can delay signals, while normalization choices, execution assumptions, and the handling of intrabar price paths can materially affect results.
Key ideas
- The strategy identifies regular and hidden divergences by comparing price pivots with indicator pivots.
- Pivot-based and immediate detection modes offer different timing behavior.
- Indicator normalization can use rolling ranges, z-scores, or median-based robust scaling.
- Stops and profit targets can be specified using ATR multiples or percentages.
- Lower-timeframe observations are used to resolve some bars that touch both exit levels, but no performance evidence is provided.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.