How to continually open same order.

  • Thread starter Thread starter Sean00
  • Start date Start date
  • Watchers Watchers 2

Sean00

Trader
Jun 12, 2023
1
0
6
61
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.
 
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.