One two three top setup event
Marks the first close 0.4% below the last 100 bars' highest close, after a close came near that high.
The reference high and low are the highest and lowest closes of the last 100 bars. The indicator runs three stages: it arms when a close is within eps (0.3%) of that high, then waits for a pullback, where a close is at least pullback (0.4%) below the high or within pullback of the 100-bar low. The marker fires on the bar that completes the pullback, not on a retest of the high. A close back within eps of the high returns the indicator to the arming stage.
How to read it
- Markers sit on the candles where a pullback from the recent high is first confirmed: the close is at least 0.4% below the high.
- Clusters of markers appear when price chops around the high, because each dip and return re-arms the indicator. A cluster is one sideways range, not stronger evidence.
- A marker says the close has dropped from the recent high. It does not say price has turned.
- The high and low are closes, so a wick above the high does not move the reference.
What it outputs
- Pullback from high
- True only on the first bar of a pullback: the close fell at least 0.4% below the 100-bar highest close, or within 0.4% of the 100-bar lowest close, after a close had come within 0.3% of that high.
When it fires
Fires on the first bar a pullback is reached: the close is at least 0.4% below the 100-bar high, or within 0.4% of the 100-bar low, after a close had come within 0.3% of that high. It marks the drop starting, not a confirmed top.
Settings
- eps
- How close a close must be to the 100-bar high to arm the indicator and to re-arm it after a pullback (default 0.003, or 0.3%). Raising it arms the indicator more often, so markers tend to rise. Below zero nothing passes, so the indicator never fires.
- pullback
- How far below the 100-bar high a close must fall to complete a pullback (default 0.004, or 0.4%). Raising it needs a deeper drop, which mostly gives fewer markers. It also widens the near-low test, which can complete a pullback sooner.
Pitfalls
- Frequent at defaults: 5,576 markers on the one-month SPY sample, about 265 a day. Treat it as a pullback detector, not a rare top pattern.
- The 100-bar high and low use closes, not highs and lows, even though the donchian docstring says highest high and lowest low. The window is 100 bars by default and this indicator's params do not change it.
- The catalog allows negative eps and pullback. A negative pullback makes the pullback test always true, so markers appear one bar after each arming.