Техническое задание
Here is a brief requirement document for developing an MT5 Expert Advisor (EA) based on the provided UT Bot Alerts Pine Script:
📌 EA Requirement: UT Bot Alerts Strategy (MT5)
🔍 Strategy Overview
This Expert Advisor will replicate the logic of the UT Bot Alerts TradingView indicator using ATR-based trailing stop logic and Heikin Ashi (optional) input for trade signals. It generates buy/sell signals based on price crossing the trailing stop derived from ATR.
🎯 Entry Rules
-
Buy Entry:
-
Price ( src ) is above the ATR trailing stop.
-
Price has crossed above the ATR trailing stop (i.e., crossover occurred).
-
-
Sell Entry:
-
Price ( src ) is below the ATR trailing stop.
-
Price has crossed below the ATR trailing stop (i.e., crossunder occurred).
-
-
Heikin Ashi Option:
-
If enabled, signals are calculated using Heikin Ashi candle close values.
-
🔄 Exit/Close Logic
-
Optional trailing stop could be implemented using the same xATRTrailingStop level as a dynamic SL.
-
Alternatively, user-defined take profit (TP) and stop loss (SL) levels can be added.
-
Only one trade should be active at a time: before opening a new trade in the opposite direction, the current one must be closed.
⚙️ Inputs / Parameters
-
KeyValue (a) : Sensitivity multiplier for ATR trailing stop (default: 1.0)
-
ATRPeriod (c) : ATR period for trailing stop calculation (default: 10)
-
UseHeikinAshi (h) : Boolean flag to use Heikin Ashi candles instead of regular price (default: false)
-
LotSize : Fixed or dynamically calculated based on account balance (optionally enable compounding)
-
MagicNumber : For identifying EA trades uniquely
-
Slippage , MaxOrders , etc.: Standard trade management options
🔔 Alerts (Optional)
-
Log/Comment when a buy/sell signal is detected.
🛠️ Additional Features
-
Trailing Stop: Dynamic SL adjustment following ATR logic.
-
Dynamic Lot Size: Based on balance or risk percentage.
-
Backtest Optimization Inputs: Allow tuning of ATR period, key value, and Heikin Ashi usage.