How to delete 1 highest or lowest pending order ?
-
I'd like to ask about deleting pending orders. I've been trying to figure out how to do it but I still can't figure it out.
I want to create a condition that sets the number of pending orders, and if there are equal to the specified number of pending orders, delete the 1 highest-ranking pending order.
My condition is
Check pending order Count -> Delete only 1 Highest or Lowest pending order of all pending.Can you help give me some advice? Thank you so much.
-
What do you exactly mean by ' Highest or Lowest pending'? Highest/Lowest price level maybe?
-
@l-andorrà I mean Highest or Lowest pending. thank you.
-
Then you need to create a loop searching for the highest and lowest price at the moment. There is no block doing that automatically. Are you familiar with loops in fxDreema?
-
@l-andorrà I think I can understand using loop, could you please guide me some idea that I can adapt it?
Thank you.
-
@gobeef Ok. This is the basic idea. You need a variables that will be storing the value of all price levels from all pending orders right now. Then you need to compare the value of that open price with the highest/lowest one up to that moment. And finally use the highest/lowest one identified to search for its ticket number (that means a second variable for it). Once the ticket number is identified you can delete that specific order. This is the first part of that structure for the highest price, for example:
-
@l-andorrà Thank you so much. I will try. ^^
-
You're welcome.