작업 종료됨
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
명시
I need an EA that would detect a crossing of a trendline (named Buy or Sell). After a break of the Buy TL, EA checks previous bars to calculate last low (LL) and continues to monitor incoming ticks to find highest price (LH) before retrace starts.
Retrace is only considered as started when prices move down by more than 23.6% from the Peak - ie Ask < LH - 0.236 X (LH-LL). If prices move down by less than 23.6%, EA continues to monitor prices to determine new Last High (LH).
Once prices retrace by more than a user defined minimum% (default 38.2%), a Buy Stop order is placed at the 23.6% retracement level (ie LH). If prices continue to move lower and move past the 50% retracement, the Buy Stop is moved to 38.2% level. When prices retrace by 61.8%, the buy stop order is placed at 50% etc etc
If prices retrace past LL or touches the LL prices, the Buy Stop order is cancelled.
STOP LOSS - SL is placed at the fibo retracement level less 1 x ATR for the chart timeframe (default value 14 period) - eg Buy stop price = 23.6 level, SL at 38.2 level less 1 x H1 ATR(14)
MOMENTUM - Whilst EA is monitoring incoming ticks to determine LH point, I want to check the body size of the 3 (this parameter needs to be variable) closed candles before TL breakout and 3 candles after breakout and compare that against the ATR of the chart timeframe (nominally H1). If 1 (default value and user changable) or more candle exceeds x% (say 50% - user changeable) of the ATR value, then we say that there is enough momentum around the breakout and only then will the EA place the buy stop.
ORDER SIZE - Fixed lot (default 0.01 lot) or fixed % risk (Default 1%) of equity
STATUS REPORTING - Current status to be reported on chart - x and y to be changeable. Some example status might be:
Trendline breakout with 3 bars greater that 50% ATR - waiting for retrace
Retrace commenced - 38.2% level crossed
Stop order deleted - retrace > 100%
Please see screenshot on how I see EA working on the AUSUSD H1 breakout
NOTE - I will require code to be delivered as MQ4 file