Check if pending order exists at current price
-
Hello
I want a pending order grid to be opened after certain conditions are met, but only if there are no pending orders at the price where the conditions are valid (i.e current price), any idea?

-
I think the question is How to detect if we have a pending order near the current price. I got this question few times before and I did nothing about it, but I think that there can be some better way to do what you want. Actually it's not impossible to detect if such order exists by using "For each Pending Order", some pink block and maybe 1 variable, but this also means more calculations. Can you give some more information about what needs to be done, why is the current price important?
If you just want to buy above the highest order or sell below the lowest, then only checking the open price of the latest order is enough.
-
Okay let me see if I can explain this,
I have a self updating grid EA.
It places pending orders as price moves up and down based on a range of pips (example: every 20pips).Now initially, say it places a grid of buy pending orders, at 1.000, 1.005 and 1.010 [1st level] and price goes higher by (20 pips),
it will place another gird of buy pending orders, if price should then go back (lower) by (20pips), it is back to the first level,
and it will place another set of pending orders at 1.000,1.005 and 1.010.I do not want that, since there are pending orders there already, I want the EA to skip placing pending orders there again.
I hope its clear

-
Wait a second, if you are now at price X and you place a new pending order at price X+1, when you reach price X+2 this pending order will not be pending order anymore, it will be turned into a running trade

-
Ah yes, I forgot that detail, still the same, I wouldn't want another set of pending orders put there, unless no trades/pending orders is running at those prices.
-
I added 2 blocks - No trade nearby and No pending order nearby