OPEN-SOURCE SCRIPT
Friedrich Indicator

This indicator visualizes trend zones using two Exponential Moving Averages (EMAs) with user-defined lengths (default 32 and 58). It identifies bullish and bearish trends based on the relationship between the shorter and longer EMA and confirms these trends only after they persist for a specified number of bars (confirmBars).
Bullish zone (green): When the shorter EMA remains above the longer EMA for at least the confirmation number of bars, both EMAs and the area between them are colored green, indicating a confirmed upward trend.
Bearish zone (red): When the shorter EMA stays below the longer EMA for at least the confirmation bars, EMAs and the filled zone turn red, signaling a confirmed downward trend.
Neutral zone (white): Before the trend confirmation, the EMAs and the area between are colored white with transparency, representing an unconfirmed or neutral state.
The area between the two EMAs is filled with the respective color, providing an intuitive visual cue of market momentum and trend strength directly on the price chart.
Bullish zone (green): When the shorter EMA remains above the longer EMA for at least the confirmation number of bars, both EMAs and the area between them are colored green, indicating a confirmed upward trend.
Bearish zone (red): When the shorter EMA stays below the longer EMA for at least the confirmation bars, EMAs and the filled zone turn red, signaling a confirmed downward trend.
Neutral zone (white): Before the trend confirmation, the EMAs and the area between are colored white with transparency, representing an unconfirmed or neutral state.
The area between the two EMAs is filled with the respective color, providing an intuitive visual cue of market momentum and trend strength directly on the price chart.
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.