OPEN-SOURCE SCRIPT
Aggiornato anand ha + Rsi

How it works:
Green Line: When RSI > 50 AND Heikin Ashi is bullish (uptrend)
Red Line: When RSI < 50 AND Heikin Ashi is bearish (downtrend)
The line dynamically positions itself below price during uptrends and above price during downtrends
Uses ATR to maintain appropriate distance from price action
Includes subtle background fill between price and the trend line
Key Features:
Single clean trend line (no candles, no extra indicators)
Color changes based on trend direction
Self-adjusting position using ATR
Smooth transitions to avoid whipsaws
Minimal visual clutter, just like SuperTrend
The line will stay green below price when both RSI is above 50 and Heikin Ashi shows bullish momentum, and red above price when both conditions turn bearish. This gives you a clear visual trend following system in a simple line format.
Green Line: When RSI > 50 AND Heikin Ashi is bullish (uptrend)
Red Line: When RSI < 50 AND Heikin Ashi is bearish (downtrend)
The line dynamically positions itself below price during uptrends and above price during downtrends
Uses ATR to maintain appropriate distance from price action
Includes subtle background fill between price and the trend line
Key Features:
Single clean trend line (no candles, no extra indicators)
Color changes based on trend direction
Self-adjusting position using ATR
Smooth transitions to avoid whipsaws
Minimal visual clutter, just like SuperTrend
The line will stay green below price when both RSI is above 50 and Heikin Ashi shows bullish momentum, and red above price when both conditions turn bearish. This gives you a clear visual trend following system in a simple line format.
Note di rilascio
How to Set Up Alerts in TradingView:Apply the indicator to your chart
Right-click on the chart → "Add Alert"
Choose your preferred alert condition:
"HA-RSI Buy/Sell Alerts" (combined)
"HA-RSI Buy Alert" (buy only)
"HA-RSI Sell Alert" (sell only)
Set your notification preferences (popup, email, webhook, etc.)
Alert Messages Include:
Clear BUY/SELL indication with colored emojis (🟢/🔴)
Ticker symbol
Current price
Descriptive message about the signal
Note di rilascio
HA-RSI 50 Trend Line IndicatorOverview
This Pine Script indicator combines Heikin Ashi candles, RSI (Relative Strength Index), and ATR-based dynamic trend lines to create a comprehensive trend-following system. It's designed to identify strong trending moves while filtering out market noise.
How It Works
Core Components
RSI Filter: Uses RSI above/below 50 as a momentum filter
Heikin Ashi Filter: Confirms trend direction using smoothed candlestick data
Dynamic Trend Line: ATR-based line that adapts to market volatility
Dual Signal System: Choose between trend change or price crossover signals
Trend Detection Logic
Bullish Trend: RSI > 50 AND Heikin Ashi close > Heikin Ashi open
Bearish Trend: RSI < 50 AND Heikin Ashi close < Heikin Ashi open
Trend Line: Positioned below price (bullish) or above price (bearish) using ATR for dynamic spacing
Signal Types
Option 1 - Trend Change Signals (Default)
Triggers when market conditions shift from bearish to bullish or vice versa
More predictive but may generate signals before price confirmation
Option 2 - Close Cross Signals
Triggers when price actually crosses above/below the trend line
More conservative, waits for price action confirmation
Visual Elements
On Chart Display
Green Line: Bullish trend (support line below price)
Red Line: Bearish trend (resistance line above price)
Fill Area: Light background color between price and trend line
Buy Signals: Green triangles below bars with "BUY" text
Sell Signals: Red triangles above bars with "SELL" text
Information Table
Real-time display showing:
Current signal type (Trend Change or Close Cross)
Current trend direction
Current RSI value
Price position relative to trend line
Input Parameters
Customizable Settings
RSI Length (14): Period for RSI calculation
ATR Length (10): Period for volatility measurement
Line Offset Multiplier (1.5): Distance of trend line from price
Enable Alerts (true): Toggle alert notifications
Signal Only on Candle Close (true): Choose signal type
Alert System
Real-time Alerts: Dynamic messages showing signal type
TradingView Alert Conditions: Three separate alert setups
Combined buy/sell alerts
Individual buy alerts
Individual sell alerts
Best Use Cases
Trending Markets
Excellent for identifying and following strong trends
Helps stay in profitable positions longer
Reduces whipsaws in trending conditions
Timeframes
Works on all timeframes
Higher timeframes (4H, Daily) tend to be more reliable
Lower timeframes provide more signals but with higher noise
Market Conditions
Best: Strong trending markets
Good: Volatile but directional markets
Avoid: Extreme choppy/sideways markets
Trading Strategy Ideas
Entry Signals
Buy: Green trend line appears OR price crosses above trend line
Sell: Red trend line appears OR price crosses below trend line
Exit Strategies
Exit when trend line changes color
Use trailing stops based on the trend line
Combine with other indicators for confirmation
Risk Management
The trend line can serve as a dynamic stop loss
ATR-based positioning naturally adjusts to volatility
Consider position sizing based on ATR values
Advantages
Combines multiple confirmation filters
Adapts to market volatility automatically
Provides clear visual trend identification
Flexible signal generation options
Built-in alert system
Limitations
May lag in very fast-moving markets
Can generate false signals in choppy conditions
Requires trend-following market conditions to perform optimally
RSI filter may miss some valid breakout moves
This indicator works best as part of a comprehensive trading system rather than as a standalone signal generator.
Note di rilascio
Key Changes Made:Removed dynamic string concatenation from alertcondition() functions
Used only Pine Script placeholders like {{ticker}} and {{close}} in alertcondition() messages
Kept the detailed Telegram messages in the alert() function calls within the if enable_alerts block
Why This Fixes The Error:
alertcondition() can only accept constant strings - no dynamic concatenation allowed
alert() function can accept series strings with dynamic concatenation
The detailed Telegram format messages will still work through the alert() calls
This approach gives you both:
Working alertcondition() functions without errors
Detailed Telegram messages with lot size, TP, and ticket numbers through the alert() calls
The error will be resolved and your script will compile successfully.
Note di rilascio
Simplified alert condition: Only one alertcondition() for the combined signalNow the indicator will send only one alert per bar with the format:
"Executed BUY XAUUSD"
"Executed SELL XAUUSD"
The alert.freq_once_per_bar ensures that even if both buy and sell conditions somehow trigger on the same bar, only one alert will be sent.
Note di rilascio
This ensures that whether you get a BUY or SELL signal (or theoretically both), you'll only receive one alert per bar with the appropriate message: "Executed BUY XAUUSD" or "Executed SELL XAUUSD".This makes your alert system clean, reliable, and prevents notification overload!
Note di rilascio
Executed {{strategy.order.action}} {{ticker}}Note di rilascio
ignal Type: Close Cross or Trend ChangeCurrent Trend: Bullish/Bearish
RSI: Current RSI value
Price vs Line: Above/Below trend line
Alert Status: ON/OFF ← NEW
Last Signal: Current signal message ← NEW
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.