Order Close/Open this Bar
to me it seems as if the function ‘Order Close (Open) this bar’ returns also the value of pending orders.
How can i get only the value of a real order opening (closing) and not of pending orders?
you are right, it counts also pending orders.
To make it behave differently you can do it by using a custom function and then define this function in /code/CustomFunctions.mq4
The custom function can use the same logic as sqOrderOpenedThisBar()/sqOrderClosedThisBar(),
but with a check if OrderProfit() > 0 or if OrderType() == OP_BUY || OP_SELL
Thanks mark, I will test it at the weekend.
Viewing 3 posts - 1 through 3 (of 3 total)