Trabalho concluído
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Termos de Referência
Hello,
This is a working EA and I would like to include 02 features.
The following is the parameters to be included. Feel free to contact me or ask with you have any idea to improve it.
01) Higher/Lower StopLoss = True or false
*It means that if this condition is false, the value of StopLoss will be exactly the manual parameter that I input, like (100, 200, 300 pips..). Or, if this parameter is "true", it means the StopLoss will be the smaller value: a) The oposite value of Higher or Lower level / b) Manual value of Stop Loss. Now the EA is working only as if this parameter is "true", but I would like to have the option that the EA works with a fixed value.
Chek those lines bellow in the EA code.
+----------------TRUE-------------------+
LowTrade
if(stoploss==0||stoploss>high-low+2*(OrderPrice+HLPriceDistance))
stoploss=high-low+2*(OrderPrice+HLPriceDistance);
HighTrade
if(stoploss==0||stoploss>high-low+2*(OrderPrice+HLPriceDistance))
stoploss=high-low+2*(OrderPrice+HLPriceDistance);
+------------------FALSE-----------------+
LowTrade
//if(stoploss==0||stoploss>high-low+2*(OrderPrice+HLPriceDistance))
// stoploss=high-low+2*(OrderPrice+HLPriceDistance);
HighTrade
//if(stoploss==0||stoploss>high-low+2*(OrderPrice+HLPriceDistance))
// stoploss=high-low+2*(OrderPrice+HLPriceDistance);
02) MARTINGALE AVERAGING SYSTEM
Martingale = True or False
Poits Distance = (double) The value of the points when market goes against the position and after the EA will send another order at the same direction.
Factor (Multiplicator) = (double) How many lots, the EA will send the new orders (always at the same direction). For example 1 means 1x(original lot), 2 means 2x(original lot), etc...
Max Martingale Orders = (int) The limit of the order the EA will send. For example, the first order is the original position, after market goes against my position, the EA will start to send orders to average my position price.
StopLoss2 = Its the new value of Stop Loss in case of the EA start the martingale. It means that I could change SL in case of my position (trade) starts to do martingale.
TakeProfit2 = Its the new value of TP in case of the EA start the martingale. It means that I could change TP in case of my tposition (trade) starts to do martingale.
*** Everytime the EA send a new order (martingale), StopLoss and TakeProfit will be updated based on the new PositionPrice.
I think you can get the main idea, but if you have any doubt we will keep in touch
Thanks