OPEN-SOURCE SCRIPT

Bullish/Bearish Trend Indicator [MTF + Alerts] by Dow theory

631
Summary of Logic:
✅ Bullish Trend:
Setup Bar: High > Previous High AND Low ≥ Previous Low
Confirmation Bar: High > Highest High of last 3 candles, Low ≥ Setup Bar Low
Trend Continues Until: Latest candle breaks 2nd last candle’s low → then trend becomes Bearish
🔻 Bearish Trend:
Setup Bar: Low < Previous Low AND High ≤ Previous High
Confirmation Bar: Low < Lowest Low of last 3 candles, High ≤ Setup Bar High
Trend Continues Until: Latest candle breaks 2nd last candle’s high → then trend becomes Bullish

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.