Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on executing DB command: System.Data.SqlServerCe.SqlCeException (0x80004005)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Error on executing DB command: System.Data.SqlServerCe.SqlCeException (0x80004005)

    I've tried to add a strategy using an instrument list. After adding them, i saw the following errors in the log:

    Error on executing DB command: System.Data.SqlServerCe.SqlCeException (0x80004005): A duplicate value cannot be inserted into a unique index. [ Table name = Strategies,Constraint name = PK__Strategies__00000000000003AB ]
    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.NinjaScript.StrategyBase.DbAdd()
    at NinjaTrader.Cbi.DB.DBThread()

    It seems that all strategies are running but what should i do with all these errors?

    #2
    Hello,

    To resolve this error please follow the instructions below to reset the NinjaTrader database. (This can take longer depending on the size of your database file and your system.)
    • Disconnect NinjaTrader from any open connections via File > Disconnect.
    • From the NinjaTrader Control Center window select the menu Tools > Options.
    • Select the 'Data' tab.
    • Press the 'Reset DB' button.
    • Press the 'OK' button.
    The following data will be removed.
    • Historical orders.
    • Historical executions.
    • Historical ATM strategy data.
    • Saved Strategy Analyzer backtest results.
    The following data will be maintained.
    • ATM strategy templates.
    • Historical chart data.
    Christopher J.NinjaTrader Customer Service

    Comment


      #3
      How do I reset DB on Ninjatrader 8.0.18?

      Comment


        #4

        Hello johnnybegoode,

        Thank you for your note.

        We advise that you use the instructions below to reset the NinjaTrader database.
        • Disconnect NinjaTrader from any open connections via Connections > Disconnect
        • From the NinjaTrader Control Center window select the menu Tools > Database Management
        • Press "Reset DB"
        • Check Historical Orders to remove historical orders
        • Check Historical Trades to remove historical trades
        • Press the "Reset" button

        Please let us know if we may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        85 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        47 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        29 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        32 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        67 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X