List of Open Order in Hedge Account MT5 New comment web11 2016.07.04 08:40 Dear,I wrote a function for get total profit to open by EA. but my function not work. I notice OrdersTotal() only send pending order only, but how i get open order only. Please someone help me to correct below coding.int Profit() { double total_profit=0; ulong ticket; for (i=OrdersTotal()-1;i>=0;i--) { if((ticket=OrderGetTicket(i))>0) { if ( (OrderGetInteger(ORDER_MAGIC)==MAGICNUMBER )) { total_profit+= ( PositionGetDouble(POSITION_PROFIT) - PositionGetDouble(POSITION_COMMISSION) - PositionGetDouble(POSITION_SWAP) ) / OrderGetDouble(ORDER_VOLUME_INITIAL) / SymbolInfoDouble(Symbol(), SYMBOL_TRADE_TICK_VALUE) / ( five ? 10 : 1 ); } } } return(total_profit); } How to Distinct Symbols of Open and Pending Orders in MT5 How to use the OrdersTotal() correctly? How to count number of pending order opened in MT5 New comment
Dear,
I wrote a function for get total profit to open by EA. but my function not work. I notice OrdersTotal() only send pending order only, but how i get open order only.
Please someone help me to correct below coding.