I'm having a problem with the following strategy:
protected override void Initialize()
{
Add(ImperialDragon(NinjaTrader.Data.PivotRange.Dai ly, NinjaTrader.Data.HLCCalculationMode.UserDefinedVal ues, 20));
CalculateOnBarClose = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (CrossAbove(GetCurrentAsk(), ImperialDragon(PivotRange.Daily, HLCCalculationMode.UserDefinedValues, 20).PP, 1))
EnterLong(2, "Going Long");
ExitLongLimit(ImperialDragon(PivotRange.Daily, HLCCalculationMode.UserDefinedValues, 20).TS11[0], "", "");
// Condition set 2
if (CrossAbove(GetCurrentAsk(), ImperialDragon(PivotRange.Daily, HLCCalculationMode.UserDefinedValues, 20).TS11, 1))
EnterLong(2, "GOING LONG");
ExitLongLimit(ImperialDragon(PivotRange.Daily, HLCCalculationMode.UserDefinedValues, 20).M6[0], "EXIT W/PROFIT", "");
Every time I initiate this strategy, I receive the following error message:
"Error on Calling 'OnBarUpdate' method for strategy 'DragonTrader': Limit price must not be 0.
Does anyone know how to fix this problem? All my variables are defined, and I've rechecked the calculations and everything appears to be correct.

Comment