Forum

help~how to get current open position info only?[MQL5]

void CheckOrder() { BuyNum= 0 ; ArraySetAsSeries (BuyOPrice, true ); ArraySetAsSeries (buy_ticketnum, true ); if ( PositionsTotal ()> 0 ) { for ( int i= 0 ;i<=BuyNum;i++) { ulong takeOrder= PositionGetTicket (i); if ( PositionSelect ( Symbol ())== true ) { if ( PositionGetSymbol

How to adjust array element position?

Hello everyone, I have an array like this: TempArray[3]={1,4,3}; How can I adjust the position to {3,4,1}? thank you

Problem about using Array[MT5]

void orderfunction::coverbuyspecific_order( string symbol_name, ENUM_POSITION_TYPE positiontype, string comment, int magic) { int pt = PositionsTotal (); for ( int i = pt - 1 ; i >= 0 ; i--) // for(int i = 0; i <= pt; i++) { ulong Pticket= PositionGetTicket (i); if (Pticket > 0

problem about assign parameter into array[MT5] help~

double Buy() { double Dist[]; ArraySetAsSeries (Dist, true ); ArrayResize (Dist, 5 , 0 ); double Buy[ 5 ]={ 1 , 2 , 3 , 4 , 5 }; for ( int i= 0 ;i>= 5 ;i++) { Dist[i]=Buy[i]; //P.S i tried ArrayCopy,ArrayInsert, those can't work } double Test= 321 ; return (Test); } why i cannot assign

About Array Problem

void CheckOrder() { SellOrderNum= 0 ; BuyOrderNum= 0 ; ArraySetAsSeries (BuyOrderOpenPrice, true ); ArraySetAsSeries (SellOrderOpenPrice, true ); ArrayResize (BuyOrderOpenPrice, PositionsTotal (), 0 ); ArrayResize (SellOrderOpenPrice, PositionsTotal (), 0 ); for ( int i= PositionsTotal ();i>= 0

About Array Memory

hello guys. I got a situation that when my EA open new order, Order Open Price will sort in Array. However, when order closed, that Open Price still in Array(e.g BuyOrderOpenPrice[0]). I tried ArrayRemove, ArrayFill, ArrayResize etc, but not work. Does anyone know how to clear array memory after