OPEN-SOURCE SCRIPT
EMA Trend Pro [Hedging & Fixed Risk]

[English]
This strategy is a comprehensive trend-following system designed to capture significant market movements while strictly managing risk. It combines multiple Exponential Moving Averages (EMAs) for trend identification, ADX for trend strength filtering, and Volume confirmation to reduce false signals.
Key Features:
Hedging Mode Compatible: The script is designed to handle Long and Short positions independently. This is ideal for markets where trends can reverse quickly or for traders who prefer hedging logic (requires hedging=true in strategy settings).
Professional Risk Management: Unlike standard strategies that use fixed contract sizes, this script calculates Position Size based on Risk. You can define a fixed risk per trade (e.g., 1% of equity or $100 fixed risk). The script automatically adjusts the lot size based on the Stop Loss distance (ATR).
Multi-Stage Take Profit: The strategy scales out positions at 3 different levels (TP1, TP2, TP3) to lock in profits while letting the remaining position ride the trend.
Strategy Logic:
Trend Identification:
Long Entry: EMA 7 > EMA 14 > EMA 21 > EMA 144 (Bullish Alignment).
Short Entry: EMA 7 < EMA 14 < EMA 21 < EMA 144 (Bearish Alignment).
Filters:
ADX Filter: Entries are only taken if ADX (14) > Threshold (default 20) to ensure the market is trending, avoiding chopping ranging markets.
Volume Filter: Current volume must exceed the 20-period SMA volume by 10% to confirm momentum.
Exits & Trade Management:
Stop Loss: Dynamic SL based on ATR (e.g., 1.8x ATR).
Breakeven: Once TP1 is hit, the Stop Loss is automatically moved to Breakeven to protect capital.
Take Profits:
TP1: 1x Risk Distance (30% pos)
TP2: 2x Risk Distance (50% pos)
TP3: 3x Risk Distance (Remaining pos)
Settings Guide:
Risk Type: Choose between "Percent" (of equity) or "Fixed Amount" (USD).
Risk Value: Input your desired risk (e.g., 1.0 for 1% risk).
Fee %: Set your exchange's Taker fee (e.g., 0.05 or 0.06) for accurate backtesting.
ADX Threshold: Adjust to filter out noise (Higher = Stricter trend requirement).
Disclaimer: This script is for educational and backtesting purposes only. Past performance does not guarantee future results. Please use proper risk management.
This strategy is a comprehensive trend-following system designed to capture significant market movements while strictly managing risk. It combines multiple Exponential Moving Averages (EMAs) for trend identification, ADX for trend strength filtering, and Volume confirmation to reduce false signals.
Key Features:
Hedging Mode Compatible: The script is designed to handle Long and Short positions independently. This is ideal for markets where trends can reverse quickly or for traders who prefer hedging logic (requires hedging=true in strategy settings).
Professional Risk Management: Unlike standard strategies that use fixed contract sizes, this script calculates Position Size based on Risk. You can define a fixed risk per trade (e.g., 1% of equity or $100 fixed risk). The script automatically adjusts the lot size based on the Stop Loss distance (ATR).
Multi-Stage Take Profit: The strategy scales out positions at 3 different levels (TP1, TP2, TP3) to lock in profits while letting the remaining position ride the trend.
Strategy Logic:
Trend Identification:
Long Entry: EMA 7 > EMA 14 > EMA 21 > EMA 144 (Bullish Alignment).
Short Entry: EMA 7 < EMA 14 < EMA 21 < EMA 144 (Bearish Alignment).
Filters:
ADX Filter: Entries are only taken if ADX (14) > Threshold (default 20) to ensure the market is trending, avoiding chopping ranging markets.
Volume Filter: Current volume must exceed the 20-period SMA volume by 10% to confirm momentum.
Exits & Trade Management:
Stop Loss: Dynamic SL based on ATR (e.g., 1.8x ATR).
Breakeven: Once TP1 is hit, the Stop Loss is automatically moved to Breakeven to protect capital.
Take Profits:
TP1: 1x Risk Distance (30% pos)
TP2: 2x Risk Distance (50% pos)
TP3: 3x Risk Distance (Remaining pos)
Settings Guide:
Risk Type: Choose between "Percent" (of equity) or "Fixed Amount" (USD).
Risk Value: Input your desired risk (e.g., 1.0 for 1% risk).
Fee %: Set your exchange's Taker fee (e.g., 0.05 or 0.06) for accurate backtesting.
ADX Threshold: Adjust to filter out noise (Higher = Stricter trend requirement).
Disclaimer: This script is for educational and backtesting purposes only. Past performance does not guarantee future results. Please use proper risk management.
Skrip open-source
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.
Pernyataan Penyangkalan
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.
Skrip open-source
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.
Pernyataan Penyangkalan
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.