Техническое задание
Hello,
I need an Expert Advisor for MetaTrader 5 based on a multi-timeframe ICT scalping strategy. The EA must be flexible, allowing different timeframes to be set in the inputs.
Core Logic:
Phase 1: Bias Determination (runs on Bias_Timeframe , e.g., H1)
-
Identify the Previous Day's High (PDH) and Low (PDL).
-
Wait for the price to sweep above the PDH or below the PDL.
-
After the sweep, wait for a Break of Structure (BoS).
-
Bullish BoS: After a PDL sweep, the price must break a significant, recent swing high.
-
Bearish BoS: After a PDH sweep, the price must break a significant, recent swing low.
-
-
This sets the dailyBias for the EA to either "BULLISH" or "BEARISH". If no signal, the bias is "NEUTRAL" and the EA does nothing.
Phase 2: Find Zone of Interest (runs on Setup_Timeframe , e.g., M15)
-
If a bias is active, identify the impulse move that caused the BoS in Phase 1.
-
Calculate the 50% equilibrium of this impulse move.
-
Search for a Fair Value Gap (FVG) within the "discount" area (below 50% for longs) or "premium" area (above 50% for shorts). This FVG is our Zone of Interest (POI).
-
If no FVG is found, the EA should do nothing.
Phase 3: Entry Confirmation (runs on the chart's timeframe, e.g., M5)
-
The EA waits for the price to retrace into the POI found in Phase 2.
-
Once the price is inside the POI, the EA must wait for a confirmation candle pattern. The main pattern is a Bullish or Bearish Engulfing candle.
-
Upon detection of the confirmation pattern, the EA enters immediately with a Market Order.
Phase 4: Trade Management
-
Stop Loss: Place SL below the low (for longs) or above the high (for shorts) of the impulse move from Phase 2.
-
Take Profit 1: TP1 is at a 1:1 Risk:Reward ratio. When TP1 is hit, the EA must close 50% of the position and move the SL of the remaining position to Break-Even.
-
Take Profit 2: The final TP is at a user-defined Risk:Reward ratio (e.g., 1:3).
Required Inputs for the EA:
-
Bias_Timeframe (Dropdown list: H4, H1, M30, M15, M5)
-
Setup_Timeframe (Dropdown list: M30, M15, M5, M1)
-
RiskPercent (e.g., 1.0)
-
RewardRatio_TP2 (e.g., 3.0)
-
TakeProfit1_RR (e.g., 1.0)
-
MagicNumber
-
SwingPoint_Bars (for identifying swing points)
Deliverable:
-
The fully functional and commented .mq5 source code file that finds and executes trades in the backtester. PS. I am open to additions and changes