When return; is called, it breaks out of the current method call (usually OnBarUpdate()), so nothing else is evaluated in the code block. Using a variable instead of return is typically a better solution:
protected override void OnBarUpdate()
{
if ((ToTime(Time[0]) >= 90000 && ToTime(Time[0]) < 160000) && (Performance.AllTrades.TradesPerformance.Currency.CumProfit > 200 || Performance.AllTrades.TradesPerformance.Currency.CumProfit < -1350))
canEnterTrade = true;
else
canEnterTrade = false;
if (canEnterTrade == true)
{
// entry logic goes here
}
// then to exit instead of enter a new trade:
if (canEnterTrade == false && Position.MarketPosition != MarketPosition.Flat)
{
ExitLong();
ExitShort();
}

Comment