Forum

How do I to close all orders limit ?

I have getting an issue that I cannot solve. The problem is that I am opening 2 orders as limit but I can't close it. I tried to use OrdersTotal() and PositionsTotal() to get the tickets and then try to close but it just doesn't works and I don't know why. How could I do this ? Trying

How do I to refresh or update the Expert Advisor when change the .ex4?

I'm looking for any solution to refresh or update the Expert Advisor programmatically and automatically whenever change the file .ex4. I found a tip to use a GlobalVariables but I do not find any example to do that, by the way, I found this https://book.mql4.com/variables/globals but it does not

OrderClose is closing order OP_SELL above and OP_BUY bellow the OrderOpened ?

I'm trying to create a dynamic Take Profit programatically. To do this I am using OrderClose() to close the order when the difference of pips are ready. The problem is that it is closing above the OP_SELL and bellow OP_BUY and I don't know why it happens. how could I fix this ? See the image