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

MQL5 Experts

Spécifications

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:


Répondu

1
Développeur 1
Évaluation
(393)
Projets
546
40%
Arbitrage
30
57% / 3%
En retard
57
10%
Gratuit
Publié : 11 codes
2
Développeur 2
Évaluation
(1)
Projets
2
0%
Arbitrage
0
En retard
1
50%
Gratuit
3
Développeur 3
Évaluation
(31)
Projets
55
5%
Arbitrage
34
0% / 94%
En retard
24
44%
Chargé
4
Développeur 4
Évaluation
(2)
Projets
2
0%
Arbitrage
1
0% / 0%
En retard
0
Gratuit
5
Développeur 5
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit

Informations sur le projet

Budget
100 - 500 USD

Client

Commandes passées3
Nombre d'arbitrages0