indicator · own pane · open source
Market Phase Detector indicator
Market Phase Detector is a free open-source indicator by @deepwick. Market Phase Detector — bins the market into 3 regimes using ADX (trending vs ranging) and… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Market Phase Detector does
Market Phase Detector — bins the market into 3 regimes using ADX (trending vs ranging) and MACD histogram (bullish vs bearish): +1 = trending bullish, -1 = trending bearish, 0 = ranging.
- Use to switch strategy: only trend-follow when |phase| = 1.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Market Phase Detector", overlay=false)
colorLine = input.color("color.blue", "Color Line")
colorNeutral = input.color("color.gray", "Color Neutral")
[plus, minus, adx] = ta.dmi(14, 14)
[m, s, h] = ta.macd(close, 12, 26, 9)
phase = adx > 25 and h > 0 ? 1 : adx > 25 and h < 0 ? -1 : 0
hline(1, "Bull trend", color=colorNeutral)
hline(-1, "Bear trend", color=colorNeutral)
p_Phase = plot(phase, "Phase", color=colorLine, style=plot.style_columns, linewidth=2)
alertcondition(phase == 1 and phase[1] != 1, "Bull phase", "Entered bull trend phase")
alertcondition(phase == -1 and phase[1] != -1, "Bear phase", "Entered bear trend phase")
No comments yet.
Sign in to comment.