__For each Pending Order -> slide order
But why... I don't think that slippage happens on pending orders, why don't you just place them on the correct price from the first time[/quote:2s0ydv5n]
I will describe my project a little more to explain where the slippage occurs. Basically, I open three buy pending orders above the price in a grid with 5 pip increments and three sell pending orders below the price with a 5 pip increment. The stoploss of all buy orders is 5 pips below the last sell pending order and the take profit 5 pips above the highest buy pending order (vice versa for sells).
Now, as the price moves and triggers, lets say buy pending order 1, the EA creates another 3 sell pending orders at the levels of the initial sell pending orders, and the same applies when it hits buy pending orders at level 2 and level 3. Basically, the EA multiplies positions to the other side, each time a pending order is hit (triggered). This is basically a cleverly hidden martingale, but lets not discuss the strategy drawbacks right now.
The problem is, when price triggers e.g. buy pending order, slippage occurs and thus the ea misplaces the 3 sell pending orders by a small bit. Therefore, I would like to adjust these displaced pending orders to the initial level, where they should be. I dont think that blocks for each pending order -> slide order are correct, because I dont know if the order will be displaced up or down. I would need something like truly, modify pending order -> move to certain level.
It is possible to see how the grid gets thicker because of misplaced pending orders by a small bit each time. I would like to keep them all stacked at the initial levels. http://imgur.com/LhdV3SV