Pr02type:
for(int i=(int)MathRound(PositionsTotal()
Why are you taking an int, converting it to a double, rounding it (which does nothing), and then converting it back to an int?
William Roeder:
Why are you taking an int, converting it to a double, rounding it (which does nothing), and then converting it back to an int?
Hello William,
thanks for your response. Indeed that is redundant. Changed the var i to an uint. Thanks for that hint.
I thought about creating a separate Function like this.
double posDat(ENUM_POSITION_PROPERTY_DOUBLE attribute, ulong ticket) { if(PositionSelectByTicket(ticket)){return(PositionGetDouble(attribute));} } return(0);}
Would that work. Or is there any other more elegant way for that comparison?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
How can i compare inside this loop the actual selected PositionInfo(select by Index) with another Positioninfo(set by Ticket).
So that for example
if(posyInfo.PriceOpen()>=posyInfo.PriceOpen(ticket){ticket=posyInfo.Ticket}
Thanks a lot in advance.