Failed to execute DB job 'StrategyUpdateJob': A foreign key value cannot be inserted because a corresponding primary key value does not exist. [Foreign key constraint name = FK__nt_strategy2instrument_00000000000002A2]. Also the error in the log says Error on calling onbarupdate method for strategy: Index was outside the bounds of the array.
I have just done a complete rebuild of ninjatrader only installing the bare minimum of what I need so is running well but not with this strategy. This error occurs the moment I run this line:
protected override void Initialize()
{
AddRenko("", 20, MarketDataType.Last);
Rest of code is:
protected override void OnBarUpdate()
if (BarsInProgress == 1)
return;
if (EMA(BarsArray[1],8)[0] > EMA(BarsArray[1],18)[0])
etc etc
I'm not sure what the issue is. As mention the moment I put in the AddRenko bit and compile I get the error.
Any ideas on this odd duck?
Thanks
DJ
Comment