The Positions[BarsInProgress].MarketPosition == MarketPosition.Long) code is supposed to check for the current market position.
If you use the Print function then what print outs are you getting.
Print(Positions[BarsInProgress].MarketPosition.ToString);
Comment