Trabajo finalizado
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Tarea técnica
The task is to make an EA for Metatrader 5. Normally this EA shall be used on M1 timeframe and only on the chart where it is attached. Settings shall be adjustable to configure it for other timeframes.
The EA shall use the following indicators:
- Correct Entry (abbrev.: “CE”, https://www.mql5.com/en/market/product/13467)
- ADX (Average Directional Movement Index, MT5 standard indicator)
- DailySize (abbrev.: “DS”, download https://www.mql5.com/en/code/13323)
The EA shall have several input parameters (name in bold letters):
CE sensitivity (default: 95)
ADX limit (default: 60)
Maximum Daily Range (DS, default: 500)
TP single position (take profit in ticks or pips, default: 30)
TP basket (take profit of the basket shall be the same money amount as TP single position, [to be discussed])
SL (stop loss in ticks or pips, default: 500, SL is applied on each position separately)
Close on reverse signal (yes/no, default: yes), thus no waiting for SL but close with opposite signal from CE indicator
Risk settings
start lot (default: 0.01)
MultiLot (yes/no, default: yes), if “yes” the start lot gets added on each grid step,(e.g. if start lot 0.1 à first grid lot is 0.2 [=0.1+0.1] à second grid lot is 0.3 [=0.1+0.1+0.1] …)
if “no” each grid step uses the start lot
max number of positions (default: 7)
Grid settings
minimumgrid step (in ticks or pips, default: 100)
Time filter (GMT)
start hour (default: 16)
end hour (open trades will be managed until TP or SL, default: 22)
end hour on Fridays (default: 17)
trade on Fridays (yes/no) (if “no” there shall be no trades on Fridays, default: no)
close open positions (close all open positions at a certain time, default: 1)
Max Spread (maximum allowed spread to open first order, default: 15)
Push notification (yes/no, send push notification if first position is opened, default: no)
Magic number (default: 19750216)
Comment (default: “RUN”)
Entry logic BUY order:
Only signals at candle close are followed.
First entry at the close of a candle with BUY Signal from CE + ADX above limit + current value of DS is below limit.
For the following grid positions only signals from CE are used.
Entry logic SELL order:
Only signals at candle close are followed.
First entry at the close of a candle with SELL Signal from CE + ADX above limit + current value of DS is below limit.
For the following grid positions only signals from CE are used.
Position management:
Normally a trade is closed by TP.
In case the grid is needed, the basket must reach TP basket (average) to get closed.
The SL is applied separately on each position. In case of one position reaching SL, the basket shall be recalculated and the TP basket shall be adjusted.
An additional grid position is opened in case of another CE signal in the same direction (BUY/SELL). The minimum grid step must be obeyed. In case there is another CE signal at candle close, but the minimum grid distance is not yet reached, the grid position is opened when minimum grid distance will be reached. If minimum grid distance is not reached, no additional grid order shall be opened.
Only signals at candle close are followed.
For all following grid orders the minimum grid distance shall be obeyed.
An opposite CE signal will close the basket (even with a loss).
All open positions shall be closed at a settable time, e.g. at night 1:00 a.m.