I am hoping to get some code to help me calculate order totals. I will be looping through all orders, then through the usual select etc, then adding the $ value through each iteration.
What is wrong w/ this logic? I seem to have no problem getting A calculation, however, it always ends up being much higher... seems to make sense to me...
Inserted Code
for(int i = 0; i < OrdersTotal(); i++) { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) { if(OrderType() == 0) { if(OrderComment() == "L") { LongsOrderProfit += (OrderProfit() + OrderSwap()); Print("Calculating Long Profit ", OrderType(), " ", LongsOrderProfit); }
What is wrong w/ this logic? I seem to have no problem getting A calculation, however, it always ends up being much higher... seems to make sense to me...
We are our own best indicator.