OPEN-SOURCE SCRIPT
Market Structure +21 EMA Hariss 369

This indicator combines Market Structure, 21-EMA trend filtering, and Break of Structure (BOS) signals to help identify trend continuation and reversal opportunities. It automatically detects swing highs and lows using a pivot-based method and classifies them into the four core structure types: HH (Higher High), HL (Higher Low), LH (Lower High), and LL (Lower Low).
Short trendline segments are drawn between consecutive pivots to visualize the evolving structure without cluttering the chart. When price breaks above a previous structure high or below a previous structure low, the indicator marks a BOS event using a dotted line on the breakout candle and a small horizontal “break line”.
A 21-period EMA acts as directional confirmation:
BUY signals appear only when price breaks structure upward and is above the EMA.
SELL signals appear only when price breaks structure downward and is below the EMA.
This makes it easier to follow the dominant trend while filtering out false breakouts. The indicator is clean, lightweight, and suitable for intraday as well as swing trading.
Short trendline segments are drawn between consecutive pivots to visualize the evolving structure without cluttering the chart. When price breaks above a previous structure high or below a previous structure low, the indicator marks a BOS event using a dotted line on the breakout candle and a small horizontal “break line”.
A 21-period EMA acts as directional confirmation:
BUY signals appear only when price breaks structure upward and is above the EMA.
SELL signals appear only when price breaks structure downward and is below the EMA.
This makes it easier to follow the dominant trend while filtering out false breakouts. The indicator is clean, lightweight, and suitable for intraday as well as swing trading.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.