How Can I Get Total Lot Size for my Buy positions?
sir7williams:
I coded this function to get the total lot size for my buy positions but it gives 0.00 all the time. Can I get assistance please
double totalBuyVolume(int Magic) { double result = 0; ulong order_ticket; int total=0; for(int i=0;i<PositionsTotal();i++) { if((order_ticket=PositionGetTicket(i))>0) if(PositionGetInteger(POSITION_MAGIC)==Magic && PositionGetString(POSITION_SYMBOL)==_Symbol && PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY) result+=PositionGetDouble(POSITION_VOLUME); } return(result); }
Thank U Sir, You provide a complete solution!!
Nikolay Georgiev:
Thank you so much sir
I coded this function to get the total lot size for my buy positions but it gives 0.00 all the time. Can I get assistance please