It appears in the log about every 10 seconds.
The strategy itself works fine.
I have no idea to track this error down.
At first I thought it might be in relation to my exit orders.
I was trying to code to exit all positions with the exit itself named.
ExitLong(Convert.ToInt32(Position.Quantity), @"BreakEven Lx", Convert.ToString(""));
For debugging purposes I inserted
ExitLong();
Still receiving error.
7/4/2021 10:55:46 AM | DB | Error on executing DB command: System.Data.SqlServerCe.SqlCeException (0x80004005): A duplicate value cannot be inserted into a unique index. [ Table name = Orders,Constraint name = PK__Orders__000000000000033E ] at System.Data.SqlServerCe.SqlCeCommand.ProcessResult s(Int32 hr) at System.Data.SqlServerCe.SqlCeCommand.ExecuteComman dText(IntPtr& pCursor, Boolean& isBaseTableCursor) at System.Data.SqlServerCe.SqlCeCommand.ExecuteComman d(CommandBehavior behavior, String method, ResultSetOptions options) at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQue ry() at NinjaTrader.Cbi.Order.DbAdd() at NinjaTrader.Cbi.DB.DBThread() |
Comment