TECHNICAL SPECIFICATION EA – H1 Trend Expansion System (Return Optimization Version)

MQL5 专家

指定

1️⃣ OVERVIEW

Platform: MetaQuotes MetaTrader 5
Language: MQL5
Timeframe: H1 (hard-coded default, but parameterized)
Default Symbol: EURUSD (must support any symbol)
Execution Mode: Market Execution


2️⃣ CORE PHILOSOPHY

System optimized for:

  • Capturing expansion after pullback

  • Maximizing R multiple

  • Allowing volatility-based scaling

  • static datetime lastBarTime;

    if(Time[0] != lastBarTime)

    {

       lastBarTime = Time[0];

       // Execute logic

    } moderate-to-high drawdown

No:static static datetime lastBarTime;

if(Time[0] != lastBarTime)

{

   lastBarTime = Time[0];

   // Execute logic

} lastBarTime;

if(Time[0] != lastBarTime)

{

   lastBarTime = Time[0];

   // Execute logic

}

  • Martingale

  • Grid

  • Hedging


3️⃣ INPUT PARAMETERS

🔹 Trend

  • EMA_Trend_Period = 200

  • EMA_Pullback_Period = 20

🔹 Risk

  • Risk_Percent = 0.5

  • Max_Open_Trades = 2

  • Max_Trades_Per_Candle = 1

🔹 Stop Loss Mode

Enum:

  • SL_FRACTAL

  • SL_LOOKBACK

Parameters:

  • Lookback_Candles = 5

🔹 Take Profit Mode

Enum:

  • TP_FIXED_RR

  • TP_TRAILING_R

Parameters:

  • RR_Ratio = 2.0

  • Trailing_Activation_R = 1.5

🔹 Volatility Filter (NEW – Required for Return Maximization)

  • ATR_Period = 14

  • Min_ATR_Value = dynamic or fixed

  • ATR_Multiplier_SL = 1.0 (optional override)

🔹 Spread Filter

  • Max_Spread_Points

🔹 Session Filter

  • Session_Start = 08:00

  • Session_End = 17:00

  • Session_Timezone = CET

  • Must auto-adjust DST

🔹 Slippage

  • Max_Slippage_Points

🔹 Magic Number

  • Magic_Number


4️⃣ TREND FILTER LOGIC

BUY allowed if:

Close[1] > EMA200

SELL allowed if:

Close[1] < EMA200

EMA calculated on close price.

No intra-candle calculation.
Signal evaluated only on new bar.


5️⃣ ENTRY LOGIC

BUY CONDITIONS:

  1. Trend bullish

  2. Candle[1] touches or closes below EMA20
    (Low[1] <= EMA20 OR Close[1] <= EMA20)

  3. Candle[0] closes above High[1]

  4. Trade executed at open of next candle

SELL = mirror logic.


6️⃣ NEW BAR DETECTION (MANDATORY)

Trade logic must execute only once per candle:

Use static datetime:


反馈

1
开发者 1
等级
(393)
项目
546
40%
仲裁
30
57% / 3%
逾期
57
10%
空闲
发布者: 11 代码
2
开发者 2
等级
(1)
项目
2
0%
仲裁
0
逾期
1
50%
空闲
3
开发者 3
等级
(31)
项目
55
5%
仲裁
34
0% / 94%
逾期
24
44%
已载入
4
开发者 4
等级
(2)
项目
2
0%
仲裁
1
0% / 0%
逾期
0
空闲
5
开发者 5
等级
项目
0
0%
仲裁
0
逾期
0
空闲

项目信息

预算
100 - 500 USD

客户

所下订单3
仲裁计数0