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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.