Hi all,
attempting a new EA, currently need to find a way to code take profit to be sent in the ordersend.
Take profit should be set at institutional levels 00 || 20 || 50 || 80 as long as that distance is more >= StopLoss (larger or equal to 1R).
So i figure i need to
-
measure distance from the bid || ask (depending on trade direction) to the nearest level
-
comparing that distance to the SL
-
take profit at the required level
The comparison side and setting take profit in to ordersend I should be fine with, just cant think of a way to measure distance from bid || ask to the nearest level.
Any suggestions would be great.