Forum

How to close all pending orders?

Hi, I am back with another question. Do you have any solution to close all stop orders ? I've been searching for a while but still haven't found the answer. below is my Pseudocode if ( OrdersTotal () < 2 ) { //close all pending orders } Thank you very much for spending time to help me

OrderOpenPrice returns 0

Hi, I tried to get the open price of an order so that I can base on that value to place a new order. For example 100 pip away from that price. I use the OrderOpenPrice() function but the value returns 0. Please help me with this issue. Here is my code: if ( OrdersTotal () < 2 ) { int

Closing order get freeze on MT4

Hello. Here is my code. it passed the compile but freeze in MT4. Could anyone please help. Sorry for my bad English. I'm not a native speaker. Thank you very much. if (((OrderType()==OP_BUY) && (signal == "sell" )) || ((OrderType() == OP_SELL) && (signal == "buy" ))) {