OPEN-SOURCE SCRIPT
EMA Cross + RSI + ADX - Autotrade Strategy V2

Overview
A versatile trend-following strategy combining EMA 9/21 crossovers with RSI momentum filtering and optional ADX trend strength confirmation. Designed for both cryptocurrency and traditional futures/options markets with built-in stop loss management and automated position reversals.
Key Features
Multi-Market Compatibility: Works on both crypto futures (Bitcoin, Ethereum) and traditional markets (NIFTY, Bank NIFTY, S&P 500 futures, equity options)
Triple Confirmation System: EMA crossover + RSI filter + ADX strength (optional)
Automated Risk Management: 2% stop loss with wick-touch detection
Position Auto-Reversal: Opposite signals automatically close and reverse positions
Webhook Ready: Six distinct alert messages for automation (Entry Buy/Sell, Close Long/Short, SL Hit Long/Short)
Performance Metrics
NIFTY Futures (15min): 50%+ win rate with ADX filter OFF
Crypto Markets: Requires extensive backtesting before live deployment
Optimal Timeframes: 15-minute to 1-hour charts (patience required for higher timeframes)
Strategy Logic
Entry Signals:
LONG: EMA 9 crosses above EMA 21 + RSI > 55 + ADX > 20 (if enabled)
SHORT: EMA 9 crosses below EMA 21 + RSI < 45 + ADX > 20 (if enabled)
Exit Signals:
Opposite EMA crossover (auto-closes current position)
Stop loss hit at 2% from entry price (tracks candle wicks)
Technical Indicators:
Fast EMA: 9-period (short-term trend)
Slow EMA: 21-period (primary trend)
RSI: 14-period with 55/45 thresholds (momentum confirmation)
ADX: 14-period with 20 threshold (trend strength filter - optional)
Market-Specific Settings
Traditional Markets (NIFTY, Bank NIFTY, S&P Futures, Options)
Recommended Settings:
ADX Filter: Turn OFF (less choppy, cleaner trends)
Timeframe: 15-minute chart
Win Rate: 50%+ on NIFTY Futures
Why No ADX: Traditional markets have more institutional participation and smoother price action, making ADX unnecessary
Cryptocurrency Markets (BTC, ETH, Altcoins)
Recommended Settings:
ADX Filter: Turn ON (ADX > 20)
Timeframe: 15-minute to 1-hour
Extensive backtesting required before live trading
Why ADX: Crypto markets are highly volatile and prone to false breakouts; ADX filters low-quality chop
Best Practices
✅ Backtest thoroughly on your specific instrument and timeframe
✅ Use larger timeframes (1H, 4H) for higher quality signals and better risk/reward
✅ Adjust RSI thresholds based on market volatility (try 52/48 for more signals, 60/40 for fewer but stronger)
✅ Monitor ADX effectiveness - disable for traditional markets, enable for crypto
✅ Proper position sizing - adjust default_qty_value based on your capital and instrument price
✅ Paper trade first - test for 2-4 weeks before risking real capital
Risk Management
Fixed 2% stop loss per trade (adjustable)
Stop loss tracks candle wicks for accurate execution
Positions auto-reverse on opposite signals (no manual intervention needed)
0.075% commission built into backtest (adjust for your broker)
Customization Options
All parameters are adjustable via inputs:
EMA periods (default: 9/21)
RSI length and thresholds (default: 14-period, 55/45 levels)
ADX length and threshold (default: 14-period, 20 threshold)
Stop loss percentage (default: 2%)
Webhook Automation
This strategy includes six distinct alert messages for automated trading:
"Entry Buy" - Long position opened
"Entry Sell" - Short position opened
"Close Long" - Long position closed on opposite crossover
"Close Short" - Short position closed on opposite crossover
"SL Hit Long" - Long stop loss triggered
"SL Hit Short" - Short stop loss triggered
Compatible with Delta Exchange, Binance Futures, 3Commas, Alertatron, and other webhook platforms.
Important Notes
⚠️ Crypto markets require extensive backtesting - volatility patterns differ significantly from traditional markets
⚠️ Higher timeframes = better results - 15min works but 1H/4H provide cleaner signals
⚠️ ADX toggle is critical - OFF for traditional markets, ON for crypto
⚠️ Not financial advice - always conduct your own research and use proper risk management
⚠️ Past performance ≠ future results - backtest results may not reflect live trading conditions
Disclaimer
This strategy is for educational and informational purposes only. Trading futures and options involves substantial risk of loss. Always backtest thoroughly, start with paper trading, and never risk more than you can afford to lose. The author assumes no responsibility for any trading losses incurred using this strategy.
A versatile trend-following strategy combining EMA 9/21 crossovers with RSI momentum filtering and optional ADX trend strength confirmation. Designed for both cryptocurrency and traditional futures/options markets with built-in stop loss management and automated position reversals.
Key Features
Multi-Market Compatibility: Works on both crypto futures (Bitcoin, Ethereum) and traditional markets (NIFTY, Bank NIFTY, S&P 500 futures, equity options)
Triple Confirmation System: EMA crossover + RSI filter + ADX strength (optional)
Automated Risk Management: 2% stop loss with wick-touch detection
Position Auto-Reversal: Opposite signals automatically close and reverse positions
Webhook Ready: Six distinct alert messages for automation (Entry Buy/Sell, Close Long/Short, SL Hit Long/Short)
Performance Metrics
NIFTY Futures (15min): 50%+ win rate with ADX filter OFF
Crypto Markets: Requires extensive backtesting before live deployment
Optimal Timeframes: 15-minute to 1-hour charts (patience required for higher timeframes)
Strategy Logic
Entry Signals:
LONG: EMA 9 crosses above EMA 21 + RSI > 55 + ADX > 20 (if enabled)
SHORT: EMA 9 crosses below EMA 21 + RSI < 45 + ADX > 20 (if enabled)
Exit Signals:
Opposite EMA crossover (auto-closes current position)
Stop loss hit at 2% from entry price (tracks candle wicks)
Technical Indicators:
Fast EMA: 9-period (short-term trend)
Slow EMA: 21-period (primary trend)
RSI: 14-period with 55/45 thresholds (momentum confirmation)
ADX: 14-period with 20 threshold (trend strength filter - optional)
Market-Specific Settings
Traditional Markets (NIFTY, Bank NIFTY, S&P Futures, Options)
Recommended Settings:
ADX Filter: Turn OFF (less choppy, cleaner trends)
Timeframe: 15-minute chart
Win Rate: 50%+ on NIFTY Futures
Why No ADX: Traditional markets have more institutional participation and smoother price action, making ADX unnecessary
Cryptocurrency Markets (BTC, ETH, Altcoins)
Recommended Settings:
ADX Filter: Turn ON (ADX > 20)
Timeframe: 15-minute to 1-hour
Extensive backtesting required before live trading
Why ADX: Crypto markets are highly volatile and prone to false breakouts; ADX filters low-quality chop
Best Practices
✅ Backtest thoroughly on your specific instrument and timeframe
✅ Use larger timeframes (1H, 4H) for higher quality signals and better risk/reward
✅ Adjust RSI thresholds based on market volatility (try 52/48 for more signals, 60/40 for fewer but stronger)
✅ Monitor ADX effectiveness - disable for traditional markets, enable for crypto
✅ Proper position sizing - adjust default_qty_value based on your capital and instrument price
✅ Paper trade first - test for 2-4 weeks before risking real capital
Risk Management
Fixed 2% stop loss per trade (adjustable)
Stop loss tracks candle wicks for accurate execution
Positions auto-reverse on opposite signals (no manual intervention needed)
0.075% commission built into backtest (adjust for your broker)
Customization Options
All parameters are adjustable via inputs:
EMA periods (default: 9/21)
RSI length and thresholds (default: 14-period, 55/45 levels)
ADX length and threshold (default: 14-period, 20 threshold)
Stop loss percentage (default: 2%)
Webhook Automation
This strategy includes six distinct alert messages for automated trading:
"Entry Buy" - Long position opened
"Entry Sell" - Short position opened
"Close Long" - Long position closed on opposite crossover
"Close Short" - Short position closed on opposite crossover
"SL Hit Long" - Long stop loss triggered
"SL Hit Short" - Short stop loss triggered
Compatible with Delta Exchange, Binance Futures, 3Commas, Alertatron, and other webhook platforms.
Important Notes
⚠️ Crypto markets require extensive backtesting - volatility patterns differ significantly from traditional markets
⚠️ Higher timeframes = better results - 15min works but 1H/4H provide cleaner signals
⚠️ ADX toggle is critical - OFF for traditional markets, ON for crypto
⚠️ Not financial advice - always conduct your own research and use proper risk management
⚠️ Past performance ≠ future results - backtest results may not reflect live trading conditions
Disclaimer
This strategy is for educational and informational purposes only. Trading futures and options involves substantial risk of loss. Always backtest thoroughly, start with paper trading, and never risk more than you can afford to lose. The author assumes no responsibility for any trading losses incurred using this strategy.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。