OPEN-SOURCE SCRIPT
Uptrend Types

Uptrend Types
Uptrend Types is a visual trend-classification indicator designed to help traders read the quality and structure of an uptrend. Instead of treating every bullish move the same way, the indicator separates bullish conditions into three practical uptrend types:
1. Sharp Uptrend
2. Steady Uptrend
3. Weak / Overlapping Uptrend
If the chart does not meet the bullish conditions, the indicator classifies the market as Down / Flat.
This script is an indicator, not a strategy. It does not place trades, does not calculate backtest results, and does not provide automatic buy or sell signals. Its purpose is to help users visually understand the current trend condition and choose the appropriate chart-reading tool for that condition.
Core idea
Many uptrends do not behave the same way.
A fast momentum move often requires attention to prior-high breakout levels.
A healthy rising trend often respects higher lows and a rising trendline.
A weak or overlapping uptrend often needs a more cautious approach using demand zones instead of chasing price.
Uptrend Types attempts to classify these different environments and display a clean visual guide on the chart.
How the indicator works
The script uses several components together:
1. EMA trend context
The indicator uses a Fast EMA and a Base EMA to understand whether price is trading in a bullish environment. It also checks whether the Fast EMA is above the Base EMA.
2. EMA slope normalized by ATR
The script calculates the slope of the Base EMA over a selected lookback period. That slope is then normalized by ATR, so the slope reading is relative to recent volatility.
This helps separate weak upward movement from stronger upward momentum.
3. RSI strength
RSI is used as a momentum filter, especially for identifying sharp uptrends. A stronger RSI reading supports the Sharp Uptrend classification.
4. Choppiness reading
The script calculates a choppiness value to determine whether price action is clean or overlapping. Higher choppiness suggests a weaker, more overlapping trend environment.
5. Swing structure
The indicator detects swing highs and swing lows using pivot logic. It then checks for higher highs and higher lows to help identify bullish structure.
Because pivots require confirmation, swing-based elements appear only after the selected number of bars has passed. This is normal behavior for pivot-based indicators.
Trend classifications
1. Sharp Uptrend
A Sharp Uptrend is detected when the market shows strong bullish context, price is above the moving averages, EMA slope is strong relative to ATR, RSI is above the selected threshold, and choppiness remains below the selected limit.
Visual tool used:
Prior-high breakout levels.
When the market is classified as a Sharp Uptrend, the indicator can draw recent prior-high levels. These levels help users focus on breakout areas and potential extension zones.
The purpose of this mode is to visually highlight that price may be moving with strong momentum. It does not mean the user should automatically enter a trade. The label reminds users not to chase late extensions.

2. Steady Uptrend
A Steady Uptrend is detected when the market shows cleaner bullish structure, including higher highs and higher lows, with a positive EMA slope and acceptable choppiness.
Visual tool used:
Rising trendline.
When this trend type is active, the indicator can draw a rising trendline from recent higher lows. This helps traders observe whether price is respecting the trend structure.
This mode is intended for healthy uptrends where pullbacks toward the trendline may be more relevant than chasing breakouts.

3. Weak / Overlapping Uptrend
A Weak Uptrend is detected when the market still has some bullish context, but the move is less clean. This can happen when choppiness is high, the slope is mild, price action is overlapping, or structure is not as strong as in a Steady or Sharp Uptrend.
Visual tool used:
Demand zones.
When this mode is active, the indicator can draw demand zones based on recent swing lows. These zones are intended to show areas where price previously reacted from lower levels.
This mode is more cautious. It suggests that the market is not in a strong clean trend and that users should avoid chasing price. The visual focus shifts to demand-zone reactions.

4. Down / Flat
If the conditions for a bullish regime are not present, the indicator classifies the market as Down / Flat.
In this state, the indicator does not try to force an uptrend interpretation. The chart label displays that there is no clean bullish setup and that the user should wait.

Important: this is not a short signal. It only means the current conditions do not qualify as one of the bullish uptrend types defined by the script.
Visual tools
The indicator includes several visual tools that can be enabled or disabled:
Prior-high breakout levels
Used mainly for Sharp Uptrend conditions.
Rising trendline
Used mainly for Steady Uptrend conditions.
Demand zones
Used mainly for Weak / Overlapping Uptrend conditions.
Attention label
A chart label that summarizes the current trend type and the visual method that fits the current environment.
Summary table
A fixed table showing the current classification, visual tool, structure reading, slope, choppiness, RSI, and rule.
Optional description panel
A simple fixed panel that summarizes the current trend condition.
Optional EMA display
Users can choose to display the Fast EMA and Base EMA.
Optional candle coloring
Candles can be colored by current trend type.
Optional background tint
A soft background tint can be used to quickly identify the current classification.
Summary table fields
Trend Type
Shows the current classification: Sharp Uptrend, Steady Uptrend, Weak / Overlap, or Down / Flat.
Visual Tool
Shows the recommended visual reading method for the current trend type:
Prior-high breakout, trendline pullback, demand zones, or wait.
Structure
Shows whether the market has HH + HL, only higher lows, only higher highs, broken structure, or no clean structure.
Slope ATR/bar
Shows the normalized EMA slope. This is the Base EMA slope divided by ATR, making the slope relative to volatility.
Choppiness
Shows whether price action is clean or overlapping.
RSI
Shows the current RSI value used in the classification process.
Rule
Shows a simple practical reminder based on the current trend type.
Settings explained
Core Engine
Fast EMA Length
Controls the shorter EMA used for trend context.
Base EMA Length
Controls the main EMA used for slope and trend direction.
ATR Length
Controls the ATR calculation used to normalize slope and zone height.
RSI Length
Controls the RSI calculation used for momentum strength.
Choppiness Length
Controls the choppiness calculation window.
EMA Slope Lookback
Controls how many bars are used to measure the Base EMA slope.
Swing Strength
Controls pivot sensitivity. Higher values create fewer, stronger swing points. Lower values create more swing points but may increase noise.
Classification
Minimum Up Slope ATR/bar
Minimum normalized slope needed to support a weak bullish context.
Steady Uptrend Slope ATR/bar
Minimum normalized slope used for Steady Uptrend classification.
Sharp Uptrend Slope ATR/bar
Minimum normalized slope used for Sharp Uptrend classification.
Sharp RSI Threshold
RSI level required to support Sharp Uptrend classification.
Weak / Overlapping Choppiness
Choppiness level used to identify weaker or more overlapping conditions.
Max Choppiness For Sharp
Maximum choppiness allowed for Sharp Uptrend classification.
Visual Display
Show Fast EMA
Displays the Fast EMA.
Show Base EMA
Displays the Base EMA.
Color Candles By Trend Type
Colors candles according to the current trend classification.
Soft Background Tint
Adds a light background color based on the current classification.
Show Summary Table
Shows or hides the main table.
Chart Attention Label
Controls where the main chart label appears or turns it off.
Attention Label Right Offset Bars
Moves the right-side label farther from or closer to the current candle.
Attention Label Vertical ATR Offset
Controls vertical spacing of the attention label.
Attention Label Size
Controls the label size.
Show Extra Fixed Description Panel
Shows an optional fixed panel with a short trend explanation.
Show HL Labels On Trendline
Shows higher-low labels on the rising trendline.
Show Prior High Text Labels
Shows text labels on prior-high breakout levels.
Infographic Tools
Draw Only Current Trend Type
When enabled, the indicator only draws the visual tool that matches the current trend type. This keeps the chart clean.
Sharp: Prior High Levels
Enables prior-high breakout levels for Sharp Uptrend conditions.
Steady: Rising Trendline
Enables the rising trendline for Steady Uptrend conditions.
Weak: Demand Zones
Enables demand zones for Weak / Overlapping Uptrend conditions.
Sharp: Max Prior High Levels
Controls the maximum number of prior-high levels shown.
Weak: Max Demand Zones
Controls the maximum number of demand zones shown.
Demand Zone Height ATR
Controls demand-zone height using ATR.
Demand Zone Projection Bars
Controls how far demand zones extend to the right.
Visual Lookback Bars
Limits how far back the indicator draws visual objects.
Colors
Sharp Uptrend Color
Color used for Sharp Uptrend visuals.
Steady Uptrend Color
Color used for Steady Uptrend visuals.
Weak Uptrend Color
Color used for Weak / Overlapping Uptrend visuals.
Down / Flat Color
Color used when no clean bullish regime is detected.
Demand Zone Fill / Border / Text Colors
Controls demand-zone appearance.
Table Background / Text Colors
Controls summary table appearance.
Demand Zone Text
Show Demand Zone Text
Shows or hides text inside demand zones.
Demand Zone Text
Custom text shown inside demand zones.
Demand Zone Text Size
Controls text size inside demand zones.
Demand Zone Text Alignment
Controls horizontal and vertical text alignment.
How to use the indicator
A practical workflow:
1. Check the table for the current trend type.
2. Read the visual tool suggested by the indicator.
3. If the trend is Sharp Uptrend, focus on prior-high breakout levels and avoid chasing late moves.
4. If the trend is Steady Uptrend, watch the rising trendline and higher-low structure.
5. If the trend is Weak / Overlapping, focus on demand-zone reactions and avoid chasing price.
6. If the trend is Down / Flat, wait for cleaner bullish structure before treating the chart as an uptrend.
This indicator is designed to support visual trend reading. It should be combined with the user’s own market structure analysis, risk management, and trading plan.
Alerts
The script includes alerts for:
Sharp Uptrend Started
Steady Uptrend Started
Weak Uptrend Started
Uptrend Ended
These alerts only notify the user that the classification has changed. They are not trade execution signals.
Limitations
This indicator does not predict future price movement.
It does not generate buy or sell signals.
It does not provide backtesting results.
Pivot-based swing points confirm after the selected pivot length, so swing labels and trendline points appear with a natural delay.
Demand zones are based on recent swing lows and ATR height. They are visual support areas, not guaranteed reversal zones.
Prior-high levels are visual breakout reference levels, not guaranteed breakout entries.
The trend type can change as new candles form and market conditions change.
Different assets and timeframes may require different settings.
Recommended use
Uptrend Types is best used as a visual trend-reading assistant for traders who want to quickly distinguish between strong momentum uptrends, cleaner steady uptrends, weaker overlapping uptrends, and non-bullish conditions.
It is intended for educational and analytical use only. It should not be used as a standalone trading system or as financial advice.
Originality and purpose
The purpose of this script is to combine several trend-reading concepts into one clean visual framework:
EMA-based trend context
ATR-normalized slope
RSI momentum strength
Choppiness / overlap detection
Higher-high and higher-low structure
Prior-high breakout levels
Rising trendline visualization
Demand-zone visualization
Summary table and attention labels
The script does not simply mark price as bullish or bearish. It attempts to classify the type of uptrend and display the most relevant visual tool for that environment.
Uptrend Types is a visual trend-classification indicator designed to help traders read the quality and structure of an uptrend. Instead of treating every bullish move the same way, the indicator separates bullish conditions into three practical uptrend types:
1. Sharp Uptrend
2. Steady Uptrend
3. Weak / Overlapping Uptrend
If the chart does not meet the bullish conditions, the indicator classifies the market as Down / Flat.
This script is an indicator, not a strategy. It does not place trades, does not calculate backtest results, and does not provide automatic buy or sell signals. Its purpose is to help users visually understand the current trend condition and choose the appropriate chart-reading tool for that condition.
Core idea
Many uptrends do not behave the same way.
A fast momentum move often requires attention to prior-high breakout levels.
A healthy rising trend often respects higher lows and a rising trendline.
A weak or overlapping uptrend often needs a more cautious approach using demand zones instead of chasing price.
Uptrend Types attempts to classify these different environments and display a clean visual guide on the chart.
How the indicator works
The script uses several components together:
1. EMA trend context
The indicator uses a Fast EMA and a Base EMA to understand whether price is trading in a bullish environment. It also checks whether the Fast EMA is above the Base EMA.
2. EMA slope normalized by ATR
The script calculates the slope of the Base EMA over a selected lookback period. That slope is then normalized by ATR, so the slope reading is relative to recent volatility.
This helps separate weak upward movement from stronger upward momentum.
3. RSI strength
RSI is used as a momentum filter, especially for identifying sharp uptrends. A stronger RSI reading supports the Sharp Uptrend classification.
4. Choppiness reading
The script calculates a choppiness value to determine whether price action is clean or overlapping. Higher choppiness suggests a weaker, more overlapping trend environment.
5. Swing structure
The indicator detects swing highs and swing lows using pivot logic. It then checks for higher highs and higher lows to help identify bullish structure.
Because pivots require confirmation, swing-based elements appear only after the selected number of bars has passed. This is normal behavior for pivot-based indicators.
Trend classifications
1. Sharp Uptrend
A Sharp Uptrend is detected when the market shows strong bullish context, price is above the moving averages, EMA slope is strong relative to ATR, RSI is above the selected threshold, and choppiness remains below the selected limit.
Visual tool used:
Prior-high breakout levels.
When the market is classified as a Sharp Uptrend, the indicator can draw recent prior-high levels. These levels help users focus on breakout areas and potential extension zones.
The purpose of this mode is to visually highlight that price may be moving with strong momentum. It does not mean the user should automatically enter a trade. The label reminds users not to chase late extensions.
2. Steady Uptrend
A Steady Uptrend is detected when the market shows cleaner bullish structure, including higher highs and higher lows, with a positive EMA slope and acceptable choppiness.
Visual tool used:
Rising trendline.
When this trend type is active, the indicator can draw a rising trendline from recent higher lows. This helps traders observe whether price is respecting the trend structure.
This mode is intended for healthy uptrends where pullbacks toward the trendline may be more relevant than chasing breakouts.
3. Weak / Overlapping Uptrend
A Weak Uptrend is detected when the market still has some bullish context, but the move is less clean. This can happen when choppiness is high, the slope is mild, price action is overlapping, or structure is not as strong as in a Steady or Sharp Uptrend.
Visual tool used:
Demand zones.
When this mode is active, the indicator can draw demand zones based on recent swing lows. These zones are intended to show areas where price previously reacted from lower levels.
This mode is more cautious. It suggests that the market is not in a strong clean trend and that users should avoid chasing price. The visual focus shifts to demand-zone reactions.
4. Down / Flat
If the conditions for a bullish regime are not present, the indicator classifies the market as Down / Flat.
In this state, the indicator does not try to force an uptrend interpretation. The chart label displays that there is no clean bullish setup and that the user should wait.
Important: this is not a short signal. It only means the current conditions do not qualify as one of the bullish uptrend types defined by the script.
Visual tools
The indicator includes several visual tools that can be enabled or disabled:
Prior-high breakout levels
Used mainly for Sharp Uptrend conditions.
Rising trendline
Used mainly for Steady Uptrend conditions.
Demand zones
Used mainly for Weak / Overlapping Uptrend conditions.
Attention label
A chart label that summarizes the current trend type and the visual method that fits the current environment.
Summary table
A fixed table showing the current classification, visual tool, structure reading, slope, choppiness, RSI, and rule.
Optional description panel
A simple fixed panel that summarizes the current trend condition.
Optional EMA display
Users can choose to display the Fast EMA and Base EMA.
Optional candle coloring
Candles can be colored by current trend type.
Optional background tint
A soft background tint can be used to quickly identify the current classification.
Summary table fields
Trend Type
Shows the current classification: Sharp Uptrend, Steady Uptrend, Weak / Overlap, or Down / Flat.
Visual Tool
Shows the recommended visual reading method for the current trend type:
Prior-high breakout, trendline pullback, demand zones, or wait.
Structure
Shows whether the market has HH + HL, only higher lows, only higher highs, broken structure, or no clean structure.
Slope ATR/bar
Shows the normalized EMA slope. This is the Base EMA slope divided by ATR, making the slope relative to volatility.
Choppiness
Shows whether price action is clean or overlapping.
RSI
Shows the current RSI value used in the classification process.
Rule
Shows a simple practical reminder based on the current trend type.
Settings explained
Core Engine
Fast EMA Length
Controls the shorter EMA used for trend context.
Base EMA Length
Controls the main EMA used for slope and trend direction.
ATR Length
Controls the ATR calculation used to normalize slope and zone height.
RSI Length
Controls the RSI calculation used for momentum strength.
Choppiness Length
Controls the choppiness calculation window.
EMA Slope Lookback
Controls how many bars are used to measure the Base EMA slope.
Swing Strength
Controls pivot sensitivity. Higher values create fewer, stronger swing points. Lower values create more swing points but may increase noise.
Classification
Minimum Up Slope ATR/bar
Minimum normalized slope needed to support a weak bullish context.
Steady Uptrend Slope ATR/bar
Minimum normalized slope used for Steady Uptrend classification.
Sharp Uptrend Slope ATR/bar
Minimum normalized slope used for Sharp Uptrend classification.
Sharp RSI Threshold
RSI level required to support Sharp Uptrend classification.
Weak / Overlapping Choppiness
Choppiness level used to identify weaker or more overlapping conditions.
Max Choppiness For Sharp
Maximum choppiness allowed for Sharp Uptrend classification.
Visual Display
Show Fast EMA
Displays the Fast EMA.
Show Base EMA
Displays the Base EMA.
Color Candles By Trend Type
Colors candles according to the current trend classification.
Soft Background Tint
Adds a light background color based on the current classification.
Show Summary Table
Shows or hides the main table.
Chart Attention Label
Controls where the main chart label appears or turns it off.
Attention Label Right Offset Bars
Moves the right-side label farther from or closer to the current candle.
Attention Label Vertical ATR Offset
Controls vertical spacing of the attention label.
Attention Label Size
Controls the label size.
Show Extra Fixed Description Panel
Shows an optional fixed panel with a short trend explanation.
Show HL Labels On Trendline
Shows higher-low labels on the rising trendline.
Show Prior High Text Labels
Shows text labels on prior-high breakout levels.
Infographic Tools
Draw Only Current Trend Type
When enabled, the indicator only draws the visual tool that matches the current trend type. This keeps the chart clean.
Sharp: Prior High Levels
Enables prior-high breakout levels for Sharp Uptrend conditions.
Steady: Rising Trendline
Enables the rising trendline for Steady Uptrend conditions.
Weak: Demand Zones
Enables demand zones for Weak / Overlapping Uptrend conditions.
Sharp: Max Prior High Levels
Controls the maximum number of prior-high levels shown.
Weak: Max Demand Zones
Controls the maximum number of demand zones shown.
Demand Zone Height ATR
Controls demand-zone height using ATR.
Demand Zone Projection Bars
Controls how far demand zones extend to the right.
Visual Lookback Bars
Limits how far back the indicator draws visual objects.
Colors
Sharp Uptrend Color
Color used for Sharp Uptrend visuals.
Steady Uptrend Color
Color used for Steady Uptrend visuals.
Weak Uptrend Color
Color used for Weak / Overlapping Uptrend visuals.
Down / Flat Color
Color used when no clean bullish regime is detected.
Demand Zone Fill / Border / Text Colors
Controls demand-zone appearance.
Table Background / Text Colors
Controls summary table appearance.
Demand Zone Text
Show Demand Zone Text
Shows or hides text inside demand zones.
Demand Zone Text
Custom text shown inside demand zones.
Demand Zone Text Size
Controls text size inside demand zones.
Demand Zone Text Alignment
Controls horizontal and vertical text alignment.
How to use the indicator
A practical workflow:
1. Check the table for the current trend type.
2. Read the visual tool suggested by the indicator.
3. If the trend is Sharp Uptrend, focus on prior-high breakout levels and avoid chasing late moves.
4. If the trend is Steady Uptrend, watch the rising trendline and higher-low structure.
5. If the trend is Weak / Overlapping, focus on demand-zone reactions and avoid chasing price.
6. If the trend is Down / Flat, wait for cleaner bullish structure before treating the chart as an uptrend.
This indicator is designed to support visual trend reading. It should be combined with the user’s own market structure analysis, risk management, and trading plan.
Alerts
The script includes alerts for:
Sharp Uptrend Started
Steady Uptrend Started
Weak Uptrend Started
Uptrend Ended
These alerts only notify the user that the classification has changed. They are not trade execution signals.
Limitations
This indicator does not predict future price movement.
It does not generate buy or sell signals.
It does not provide backtesting results.
Pivot-based swing points confirm after the selected pivot length, so swing labels and trendline points appear with a natural delay.
Demand zones are based on recent swing lows and ATR height. They are visual support areas, not guaranteed reversal zones.
Prior-high levels are visual breakout reference levels, not guaranteed breakout entries.
The trend type can change as new candles form and market conditions change.
Different assets and timeframes may require different settings.
Recommended use
Uptrend Types is best used as a visual trend-reading assistant for traders who want to quickly distinguish between strong momentum uptrends, cleaner steady uptrends, weaker overlapping uptrends, and non-bullish conditions.
It is intended for educational and analytical use only. It should not be used as a standalone trading system or as financial advice.
Originality and purpose
The purpose of this script is to combine several trend-reading concepts into one clean visual framework:
EMA-based trend context
ATR-normalized slope
RSI momentum strength
Choppiness / overlap detection
Higher-high and higher-low structure
Prior-high breakout levels
Rising trendline visualization
Demand-zone visualization
Summary table and attention labels
The script does not simply mark price as bullish or bearish. It attempts to classify the type of uptrend and display the most relevant visual tool for that environment.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.