OPEN-SOURCE SCRIPT
Updated 📊 TREND Indicator by Yogesh Mandloi 📊

This custom-built TradingView indicator provides a visual and logic-based trend analysis dashboard using 4-hour RSI and EMA/SMA conditions, combined with entry/exit signals, alerts, and a toggle-controlled condition table.
🔍 Core Logic
The strategy uses 4-hour timeframe data to identify potential bullish or bearish trends based on:
RSI (14):
Buy: RSI > 48
Sell: RSI < 52
EMA/SMA (Trend Filters):
Buy: EMA 21 > SMA 55 High → uptrend confirmation
Sell: EMA 21 < SMA 55 Low → downtrend confirmation
Buy Signal = RSI > 48 AND EMA21 > SMA55 High
Sell Signal = RSI < 52 AND EMA21 < SMA55 Low
It only signals on first bar of condition (no repetitive signals) and gives exit alerts when the condition ends.
📈 Features
✅ Signal Plotting
Green "BUY" arrows below bars when buy setup forms
Red "SELL" arrows above bars when sell setup forms
Gray "EXIT" markers when the trend condition invalidates
✅ Real-Time Alerts
Entry alerts for both BUY and SELL signals
Exit alerts to close positions
✅ Dynamic Visual Table
An on-screen signal table shows the live status of each condition with color-coded clarity:
✅ Green: Condition met
❌ Red: Condition not met
🟧 Orange: Warning (bearish potential forming)
✅ Toggle Switches for Sections
Users can control the visibility of each table section:
Buy Conditions ✔️
Sell Conditions 🔻
Signal Summary 📌
Indicator Values 📊
This makes it easier to focus on relevant sections or declutter the chart view.
✅ Customizable Table Position
You can change the table location:
top_left, top_right, bottom_left, bottom_right
✅ Background Highlights
Light Green background when buy conditions are active
Light Red background when sell conditions are active
🔍 Core Logic
The strategy uses 4-hour timeframe data to identify potential bullish or bearish trends based on:
RSI (14):
Buy: RSI > 48
Sell: RSI < 52
EMA/SMA (Trend Filters):
Buy: EMA 21 > SMA 55 High → uptrend confirmation
Sell: EMA 21 < SMA 55 Low → downtrend confirmation
Buy Signal = RSI > 48 AND EMA21 > SMA55 High
Sell Signal = RSI < 52 AND EMA21 < SMA55 Low
It only signals on first bar of condition (no repetitive signals) and gives exit alerts when the condition ends.
📈 Features
✅ Signal Plotting
Green "BUY" arrows below bars when buy setup forms
Red "SELL" arrows above bars when sell setup forms
Gray "EXIT" markers when the trend condition invalidates
✅ Real-Time Alerts
Entry alerts for both BUY and SELL signals
Exit alerts to close positions
✅ Dynamic Visual Table
An on-screen signal table shows the live status of each condition with color-coded clarity:
✅ Green: Condition met
❌ Red: Condition not met
🟧 Orange: Warning (bearish potential forming)
✅ Toggle Switches for Sections
Users can control the visibility of each table section:
Buy Conditions ✔️
Sell Conditions 🔻
Signal Summary 📌
Indicator Values 📊
This makes it easier to focus on relevant sections or declutter the chart view.
✅ Customizable Table Position
You can change the table location:
top_left, top_right, bottom_left, bottom_right
✅ Background Highlights
Light Green background when buy conditions are active
Light Red background when sell conditions are active
Release Notes
📊 TREND Indicator by Yogesh Mandloi – DescriptionThis indicator combines RSI and EMA/SMA crossovers on the 4H timeframe to generate actionable Buy and Sell signals. It offers visual signals on the chart, exit alerts, and a customizable signal table.
✅ Core Logic
Buy Condition:
4H RSI > 48
4H EMA(21) > 4H SMA(55) of high
Sell Condition:
4H RSI < 52
4H EMA(21) < 4H SMA(55) of low
Entry signals are triggered only when a new condition starts.
Exit signals appear when the condition ends (trend weakens or reverses).
📌 On-Chart Features
Buy Arrow: Lime green arrow below bar when buy setup begins.
Sell Arrow: Red arrow above bar when sell setup begins.
Exit Markers: Gray X symbols when a condition ends.
🛎️ Alerts
Buy and Sell setup alerts.
Close (exit) alerts for both directions.
📋 Signal Table
The floating table includes:
✅ Buy Conditions status (RSI + MA confirmation)
🔻 Sell Conditions status (RSI + MA confirmation)
🔄 Signal Summary (Bullish/Bearish confirmation)
📈 Indicator Values (4H RSI, EMA21, SMA55 High & Low)
🔘 Toggle options to show/hide individual table sections.
🎨 Background Color Highlight
Light green when Buy condition is fully active.
Light red when Sell condition is fully active.
(Subtle for visual trend zone confirmation.)
🧩 Customizable Inputs
Table position: top-left, top-right, bottom-left, bottom-right.
Toggle sections: Buy/Sell logic, Signal Summary, Indicator values.
Release Notes
📊 TREND Indicator by Yogesh Mandloi – DescriptionThis indicator combines RSI and EMA/SMA crossovers on the 4H timeframe to generate actionable Buy and Sell signals. It offers visual signals on the chart, exit alerts, and a customizable signal table.
✅ Core Logic
Buy Condition:
4H RSI > 48
4H EMA(21) > 4H SMA(55) of high
Sell Condition:
4H RSI < 52
4H EMA(21) < 4H SMA(55) of low
Entry signals are triggered only when a new condition starts.
Exit signals appear when the condition ends (trend weakens or reverses).
📌 On-Chart Features
Buy Arrow: Lime green arrow below bar when buy setup begins.
Sell Arrow: Red arrow above bar when sell setup begins.
Exit Markers: Gray X symbols when a condition ends.
🛎️ Alerts
Buy and Sell setup alerts.
Close (exit) alerts for both directions.
📋 Signal Table
The floating table includes:
✅ Buy Conditions status (RSI + MA confirmation)
🔻 Sell Conditions status (RSI + MA confirmation)
🔄 Signal Summary (Bullish/Bearish confirmation)
📈 Indicator Values (4H RSI, EMA21, SMA55 High & Low)
🔘 Toggle options to show/hide individual table sections.
🎨 Background Color Highlight
Light green when Buy condition is fully active.
Light red when Sell condition is fully active.
(Subtle for visual trend zone confirmation.)
🧩 Customizable Inputs
Table position: top-left, top-right, bottom-left, bottom-right.
Toggle sections: Buy/Sell logic, Signal Summary, Indicator values.
Release Notes
📊 TREND Indicator by Yogesh Mandloi – DescriptionThis indicator combines RSI and EMA/SMA crossovers on the 4H timeframe to generate actionable Buy and Sell signals. It offers visual signals on the chart, exit alerts, and a customizable signal table.
✅ Core Logic
Buy Condition:
4H RSI > 48
4H EMA(21) > 4H SMA(55) of high
Sell Condition:
4H RSI < 52
4H EMA(21) < 4H SMA(55) of low
Entry signals are triggered only when a new condition starts.
Exit signals appear when the condition ends (trend weakens or reverses).
📌 On-Chart Features
Buy Arrow: Lime green arrow below bar when buy setup begins.
Sell Arrow: Red arrow above bar when sell setup begins.
Exit Markers: Gray X symbols when a condition ends.
🛎️ Alerts
Buy and Sell setup alerts.
Close (exit) alerts for both directions.
📋 Signal Table
The floating table includes:
✅ Buy Conditions status (RSI + MA confirmation)
🔻 Sell Conditions status (RSI + MA confirmation)
🔄 Signal Summary (Bullish/Bearish confirmation)
📈 Indicator Values (4H RSI, EMA21, SMA55 High & Low)
🔘 Toggle options to show/hide individual table sections.
🎨 Background Color Highlight
Light green when Buy condition is fully active.
Light red when Sell condition is fully active.
(Subtle for visual trend zone confirmation.)
🧩 Customizable Inputs
Table position: top-left, top-right, bottom-left, bottom-right.
Toggle sections: Buy/Sell logic, Signal Summary, Indicator values.
Release Notes
This indicator combines RSI and EMA/SMA crossovers on the 4H timeframe to generate actionable Buy and Sell signals. It offers visual signals on the chart, exit alerts, and a customizable signal table.✅ Core Logic
Buy Condition:
4H RSI > 48
4H EMA(21) > 4H SMA(55) of high
Sell Condition:
4H RSI < 52
4H EMA(21) < 4H SMA(55) of low
Entry signals are triggered only when a new condition starts.
Exit signals appear when the condition ends (trend weakens or reverses).
📌 On-Chart Features
Buy Arrow: Lime green arrow below bar when buy setup begins.
Sell Arrow: Red arrow above bar when sell setup begins.
Exit Markers: Gray X symbols when a condition ends.
🛎️ Alerts
Buy and Sell setup alerts.
Close (exit) alerts for both directions.
📋 Signal Table
The floating table includes:
✅ Buy Conditions status (RSI + MA confirmation)
🔻 Sell Conditions status (RSI + MA confirmation)
🔄 Signal Summary (Bullish/Bearish confirmation)
📈 Indicator Values (4H RSI, EMA21, SMA55 High & Low)
🔘 Toggle options to show/hide individual table sections.
🎨 Background Color Highlight
Light green when Buy condition is fully active.
Light red when Sell condition is fully active.
(Subtle for visual trend zone confirmation.)
🧩 Customizable Inputs
Table position: top-left, top-right, bottom-left, bottom-right.
Toggle sections: Buy/Sell logic, Signal Summary, Indicator values.
Release Notes
The TREND Indicator is a multi-factor trading tool designed to identify buy and sell opportunities on the 4-hour (4H) timeframe, combining momentum and trend logic through RSI and moving average analysis, with a clean visual dashboard.🔍 Core Logic & Conditions
✅ Buy Signal
A buy condition is triggered when:
RSI (14) > 48 (momentum shift upwards)
EMA 21 > SMA 55 High (short-term trend above long-term resistance)
🔻 Sell Signal
A sell condition is triggered when:
RSI (14) < 52 (momentum weakening)
EMA 21 < SMA 55 Low (short-term trend below long-term support)
The indicator waits for a new signal (i.e., condition becomes true now but was false in the previous candle) before showing BUY/SELL arrows.
📈 Trend Strength Measurement
A calculated trend strength score combines:
RSI deviation from neutral (50)
EMA vs. SMA gap as a percentage of price
This score classifies market conditions into:
Strong Bull
Moderate Bull
Weak Bull
Neutral
Weak Bear
Moderate Bear
Strong Bear
These categories are color-coded for visual clarity.
📋 Signal Table Dashboard
A compact, real-time table (optional via toggle) displays:
Metric Meaning
RSI ⬆⬇ Momentum direction (⬆ = Bullish)
MA ⬆⬇ Trend direction via EMA/SMA
Trend Strength Bull/Bear classification with color
RSI / MA Values Exact values of RSI, EMA21, SMA55
(Optional) RSI Trend Emoji sparkline (↗↘→) showing 3-bar trend
🔔 Alerts
Built-in alerts notify on:
✅ New Buy Signal
🔻 New Sell Signal
Messages include RSI and MA condition context.
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.