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

MQL5 Experts

Termos de Referência

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:


Respondido

1
Desenvolvedor 1
Classificação
(393)
Projetos
546
40%
Arbitragem
30
57% / 3%
Expirado
57
10%
Livre
Publicou: 11 códigos
2
Desenvolvedor 2
Classificação
(1)
Projetos
2
0%
Arbitragem
0
Expirado
1
50%
Livre
3
Desenvolvedor 3
Classificação
(31)
Projetos
55
5%
Arbitragem
34
0% / 94%
Expirado
24
44%
Carregado
4
Desenvolvedor 4
Classificação
(2)
Projetos
2
0%
Arbitragem
1
0% / 0%
Expirado
0
Livre
5
Desenvolvedor 5
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre

Informações sobre o projeto

Orçamento
100 - 500 USD

Cliente

Pedidos postados3
Número de arbitragens0