OrderProfit() Need Help Seperating OP_BUY from OP_SELL
OpenBuyProfit+=OrderProfit()+OrderSwap()+OrderCommission();
Slawa thanks for replying. I have tried to change but still get value of 0
OrderSelect(i, SELECT_BY_POS );
if ( OrderSymbol() == Symbol() && OrderMagicNumber() == forMagic && type == OP_BUY)
{
OpenBuyProfit += OrderProfit()+OrderSwap()+OrderCommission();
Try to print selected orders
Instead of manually counting both profits, I am trying to post a comment that shows each individual totals.
Here is sample code I am using. I know it's not right, so maybe someone could assist?
Thank you in advance.
OpenBuyProfit = 0; total = OrdersTotal(); for(i=0;i<total;i++) { OrderSelect(i, SELECT_BY_POS ); if ( OrderSymbol() == Symbol() && OrderMagicNumber() == forMagic && type == OP_BUY) { OpenBuyProfit = OpenBuyProfit + OrderProfit(); } }