Double top sell
Sell marker after a double top breaks down, which never happens at default settings.
It watches closes against the highest and lowest close of the last 100 bars, the current bar included. It arms when a close returns within eps of that high after a dip of at least pullback, which is the second top. Once armed it never resets, and the sell marks the bar after the second top only if that close is below the 100-bar low moved by band, a test the default band of 0 can never pass.
How to read it
- Markers sit on the candles; nothing is drawn in its own pane.
- On a month of SPY one-minute bars at default settings the chart shows zero sell markers.
- A marker means price closed under the recent 100-bar closing low on the bar after a second top.
- The pattern fires at most once per run, so later tops in the same run stay silent.
What it outputs
- Sell
- Marks the bar after a second top when that close breaks below the 100-bar closing low moved by band.
When it fires
On the bar after a second top: price came back within eps of the 100-bar closing high after a dip of at least pullback, and that next close is below the 100-bar closing low moved by band. Fires at most once per run.
Settings
- eps
- How close a close must get to the 100-bar closing high to count as a top, as a fraction (0.003 is 0.3 percent). Raising it accepts looser tops; lowering it demands a near-exact retest. Below zero nothing matches, so the pattern never arms.
- pullback
- How far the close must fall below the 100-bar closing high between the two tops, as a fraction (0.006 is 0.6 percent). Raising it demands a deeper dip. Zero or below drops the dip requirement, and 1 or more never matches.
- band
- Margin on the breakdown level: the sell needs a close below the 100-bar closing low moved by this fraction. Zero or above can never fire. Below zero, a close up to that fraction above the low counts, so -0.01 loosens it and -0.5 removes the check.
- confirm_days
- How many bars in a row the breakdown must hold before a sell is drawn. Above 1 it stops every sell, because the breakdown is true on only one bar.
Pitfalls
- At the default band of 0 the sell cannot fire: the 100-bar low already includes the current close, so a close can never sit below it. Only a negative band draws markers.
- Once the first top is set the pattern waits with no timeout and never resets, so one armed run silences every later top in that run.
- The 100-bar high and low use closes, not intraday highs and lows, so wicks never count toward a top or a breakdown.