I am testing a scalping algo and am having issues calculating independent order profits. Can anyone help?

It's only printing an erroneous BUYORDERSPROFIT, and one of USDJPYBUYOPL, or,EURUSDBUYOPL, together with one of these printing as 0 that is mucking up the calculation and closing trades irrespective of P/L.

The main problem is the calculation for BUYORDERSPROFIT isn't shutting on larger than 0.

What am I doing wrong here? Total code under...

Inserted Code void CalcOP() int totalorders = OrdersTotal(); for(int I=totalorders-1;igt;=0;I--) ((OrdersTotal() gt; 0) (OrderType() == OP_SELL) (OrderSymbol() == EURUSD) ((SELLORDERSPROFIT) gt; 0) ((SELLORDERSPROFIT) gt; ( OrderLots()*PT )))) Print(SELLORDERSPROFIT,,USDJPYSELLOPL,,EURUSDSELLO PL,,MarketInfo(USDJPY,MODE_ASK),,MarketInfo(EURUSD ,MODE_ASK)); CloseOutSELLORDERS(); return;