check distance between pending orders and current price

 
Hello
I want to write a program that will add a certain number of pending orders every time the current price moves by a certain amount (for example, 100 pips or by a certain range, for example, 90 to 110 pips), compared to the last and closest pending order. to do once in the condition).
And the bet is stopped until the last pending order takes the same distance from the current price.

(only check the condition once and again)


 

There is no need to create pending orders in code.

  1. The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)

    Don't worry about it unless you're scalping M1 or trading news.

  2. Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.

Reason: