How to continually open same order.

Sean00

Trader
Jun 12, 2023
1
0
6
60
I can't seem to find a clean piece of code to continually place the same order after it TP. Should the magic number be used? Example: If the buy order triggers at 5 and takes profit at 8, what would the code be to immediately place another buy order at 5. And if the price keeps going up and down as in a range new orders would continue to open after each TP. This would continue until the EA is closed. Thanks for any help.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,245
1,507
144
Odesa
www.earnforex.com
There are several ways to do this. One is for the EA to monitor its open trades, check closed trades, and if the last trade closed by TP, open a new trade. Another way would be to place a pending order near the TP of the current trade beforehand.