why don`t you make extra variables. which inform if first order has been placed or not and only then check for positions i.e if your trade is MIS instead of CNC.
i don`t remember VBA syntax but logically:
if ( firstOrderPlaced == true ) then checkPositions if ( YourCriteriaSatisfies ) then setTradeDirection placeOrder else if ( YourCriteriaSatisfies ) then setTradeDirection placeOrder firstOrderPlaced = true
CNC.i don`t remember VBA syntax but logically:
and similarly for other checks also
Thanks
Regards