Cant get modify stops block to work
-
Hi all. Please help. My EA is programmed to open two trades. When certain conditions are met it needs to close the most profitable one (this is working), send a notification (also working) and modify the stop of the remainder based on the result of the below (not working). Not sure why the stop is not being modified?

-
You are using those (on trade) options, but they are only do be used under the "on Trade" event. Are those blocks under "on Trade"?
I think you have this calculation:
OpenPrice - (ClosePrice - OpenPrice)
To which trade that ClosePrice belongs to? While the trade is running, this is the current price and only after it closes it is the real price where it closed. Do you mean the current price of the current trade and do you want to do this for each trade?
I'm not sure, but maybe you want to do something like this:

The formula I wrote here is:
MathAbs(OrderClosePrice() - OrderOpenPrice())...where MathAbs(), OrderOpenPrice() and OrderClosePrice() are native functions in MQL4. Note that I selected Custom (price fraction)
-
@fxdreema said in Cant get modify stops block to work:
MathAbs(OrderClosePrice() - OrderOpenPrice())
Works perfect thank you