//As a class variable private TradingAllowed = false;
else if (State == State.DataLoaded) { if (ConditionA){ Print("ERROR, don't run script"); Log("ERROR, don't run script", NinjaTrader.Cbi.LogLevel.Error); TradingAllowed = false; } else { TradingAllowed = true; } }
//In OnBarUpdate if (!TradingAllowed) return; //rest of OBU goes here
Leave a comment: