工作已完成
![](https://c.mql5.com/i/avatar/avatar_na2.png)
指定
JOB Add 3 improvements to my EA for Peter Gregory
ECN-compatible — such expert advisor have a special input parameter called ECN_Mode
1) Add trailing stop either standard one or one using ATR
2) Add Breakout filter logic to order entry as described below
3) Add third method of initiating a trade using the TDI Red Green indicator attached
Turtle logic does not buy/sell until the price is above/below a previous high/low
Item 1 is trailing stop
See examples below or if you have your own trailing stop let me know how it works
Item 2 Changing the order entry method from simple cross over of ROC2 over ROC 1 to add breakout logic below
Attached is a screen shot of what I am talking about breakout 2
It shows a green arrow when ROC2 crosses ROC1 this is a buy signal (signal candle ) and the buy order is generated on the completion of the signal candle (the next candle)
I want to change the signal from placing the buy/sell order automatically to being conditional on having conditions 1), 2),3) being met
In the example the nearest high was the candle before the signal candle or 1 candle before the signal candle 1) condition 1 x=1
Condition 2) The buy/sell signal will only be acted upon and order placed if the current price is
(x) Pips above/below the nearest high/low stipulated in condition 1)
Condition 3) says that rather than order being placed immediately if conditions 1&2 are met that the order can be made if conditions 1&2 are met for the next (x) candles that way if the current price dips for a few candles then proceeds above the nearest high/low the order is placed. if the current price does not go above/below the nearest high/low then the order is not placed
Inputs for item 2
1) High or low (x) candles ago (in attached example x=1)
2) Close of signal candle is (x) pips above a high in a buy and below on a sell
3) The number of candles (x) after the signal candle that condition 2) will initiate an order
The closest logic I found on MQL5 is https://www.mql5.com/en/code/10735 Turtle logic
Item 3 uses TDI Red Green indicator to initiate a trade
When Green crosses above red it opens a buy trade with the logic of item 2 trade closes by one of 4 methods depending on which is triggered first SL , break even, trailing stop or TP
When green crosses below Red a sell trade is initiated[PG1] using same logic in item 2 and same closing logic as buy trade