Double bottom buy
Buy marker one candle after a double bottom, if that candle closes above the 100-bar high; at default settings it never fires.
The indicator tracks close against its 100-bar Donchian channel of closes. A second bottom forms when close returns within eps of the low after bouncing at least pullback above it, and the state machine never leaves that state, so this happens at most once in the history. The buy is tested only on the next candle: its close must be above the 100-bar high less band. As coded it looks broken, since the test can never pass at band 0 or above, because that high already includes the current close.
How to read it
- Markers appear only on the candle after a second bottom, and only if that candle closes above the 100-bar high less the band.
- At the default band of 0 there are no markers: the high already includes the current close, so a close can never exceed it.
- A negative band, such as -0.005, lets the close sit that fraction below the high and still count, which is how any marker appears.
- Expect at most one marker across the whole chart history, since the setup forms once and does not re-arm.
What it outputs
- Double bottom breakout buy
- A buy marker on the candle after a second bottom, when that candle closes above the 100-bar high less the band. No marker on any other candle.
When it fires
On the candle after a second bottom, when its close is above the 100-bar high less the band. A second bottom means close returned within eps of the 100-bar low after a pullback bounce. The setup forms at most once, so the marker appears at most once; at defaults it never appears.
Settings
- eps
- How close close must sit to the 100-bar low to count as touching it, as a fraction (0.003 is 0.3%). Raising it accepts looser lows and can form the setup sooner. At 0 only an exact touch counts, and below 0 nothing does, so it never fires.
- pullback
- How far close must rise above the first low (0.006 is 0.6%) before a return to the low counts as the second bottom. Raising it demands a deeper bounce, so the setup is rarer and later. At 0 or below, the next candle counts.
- band
- Offset of the breakout line from the 100-bar high (0.005 is 0.5%). At 0 or above, close must beat a high that already includes it, so it never fires. Negative values, such as -0.005, accept a close that far below the high; more negative fires more easily.
- confirm_days
- Bars the breakout must hold in a row before it fires. Above 1 it never fires, because the breakout is true on the single candle after the second bottom. Keep it at 1.
Pitfalls
- The pattern never resets. After the first second bottom the state machine has no exit, so later double bottoms are ignored and the buy can only be tested on the candle right after that one event.
- On SPY one-minute bars for September 2026 it fired 0 times at defaults. With band -0.001, -0.005 or -0.01 the same setup gave one marker on the next candle.
- On SPY in that month the 100-bar channel was only about 0.4% wide around the setup, so a band of -0.5% or -1% was met on the next candle and the marker says little beyond that.