Swing Strategy with TP Signal, RSI, EMA, Alerts

This strategy detects swing highs and swing lows in real time and executes trades at key turning points — enhanced by momentum and trend filters.
It’s ideal for traders who prefer to:
Enter near market extremes
Use simple price action + indicator confluence
See clear visual confirmations for entry and take profit
🔍 How It Works
Swing Detection: Uses a custom swing high/low algorithm that spaces signals to avoid clutter.
Buy Setup:
A new swing low is detected
RSI is below a user-defined threshold (default 40 = oversold)
Price is above the EMA (confirming trend support)
Sell Setup:
A new swing high is detected
RSI is above a threshold (default 60 = overbought)
Price is below the EMA (confirming downtrend pressure)
When all conditions are met, the strategy places a market order with:
Stop Loss: % below/above entry (user defined)
Take Profit: % above/below entry
💰 Take Profit Signals
When a trade hits TP, a green or red circle is plotted on the chart to show the exit point
This helps visually confirm that the strategy hit its goal and managed risk correctly
⚙️ Fully Configurable
Swing Length: Number of bars to consider for swing points
Min Bars Between Swings: Avoid overlapping signals
RSI Length and thresholds
EMA Length for trend filtering
TP/SL %: Adjustable per instrument
📈 Great For
Scalping or swing trading
Trend pullback traders
Anyone who likes clean signals with stop/target logic
🔔 Includes Alerts
Real-time alerts for both BUY and SELL setups
This strategy automatically detects swing highs and lows, then enters trades at key reversal zones with confluence from trend and momentum filters. Designed for traders who want to catch pullbacks or reversals with confirmation and clear risk management.
🔍 How It Works
✅ Swing Detection: Uses real-time logic to find local highs and lows, filtered to prevent noise or overlap.
✅ Trade Entries:
Buy when a swing low forms, RSI is below 40 (oversold), and price is above the 50 EMA.
Sell when a swing high forms, RSI is above 60 (overbought), and price is below the 50 EMA.
✅ SL/TP Included: Fixed Stop Loss and Take Profit (configurable %).
✅ TP Signals: Plots a marker on the candle where Take Profit was hit, for easy visual confirmation.
🟢🔴 Visual Features
Swing Highs and Lows marked on the chart
Buy/Sell signal labels
Green and Red trendlines dynamically updating from the latest swing low/high to current price
EMA plotted for directional bias
TP markers shown when profit targets are reached
⚙️ Inputs You Can Control
Swing length and spacing (how sensitive the pivots are)
RSI and EMA lengths
Thresholds for RSI filtering
Stop loss and take profit percentages
🔔 Alerts Included
BUY and SELL alerts trigger in real time when all conditions align
🧠 Best For:
Intraday reversal traders
Pullback traders who want RSI + EMA confirmation
Clean, mechanical setups with built-in SL/TP
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.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.
Declinazione di responsabilità
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.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.