Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on executing DB command...

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

    Error on executing DB command...

    Hi,

    I left my Strategy run last night on a sim account and this morning when I came to check on the strategy performance, my NT8 application had crashed. I opened NT8and checked the log that has the following errors. Do you guys know what could cause these errors?

    Thanks,
    12/10/2020 3:25 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 ]
    12/10/2020 3:25 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 ]
    12/10/2020 3:25 DB Error on executing DB command: System.Data.SqlServerCe.SqlCeException (0x80004005): A duplicate value cannot be inserted into a unique index. [ Table name = Executions,Constraint name = PK__Executions__0000000000000300 ]
    12/10/2020 3:25 DB Error on executing DB command: System.Data.SqlServerCe.SqlCeException (0x80004005): A duplicate value cannot be inserted into a unique index. [ Table name = Executions,Constraint name = PK__Executions__0000000000000300 ]
    12/10/2020 3:25 DB Error on executing DB command: System.Data.SqlServerCe.SqlCeException (0x80004005): A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = FK__Strategy2Order__0000000000000403 ]
    12/10/2020 3:25 Order Order='fcd05e30e51c4168930f01d573b49470/Sim101' Name='STUBackTest_LSL_4-NQ 12-20' New state='Accepted' Instrument='NQ 12-20' Action='Sell' Limit price=0 Stop price=12334 Quantity=3 Type='Stop Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    12/10/2020 3:25 Order Order='fcd05e30e51c4168930f01d573b49470/Sim101' Name='STUBackTest_LSL_4-NQ 12-20' New state='Submitted' Instrument='NQ 12-20' Action='Sell' Limit price=0 Stop price=12334 Quantity=3 Type='Stop Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    12/10/2020 3:25 Position Instrument='NQ 12-20' Account='Sim101' Average price=12341.583333333334 Quantity=3 Market position=Long Operation=Update
    12/10/2020 3:25 Execution Execution='1b7dc1fd846e4cbd9f9502d9ac1d5ef6' Instrument='NQ 12-20' Account='Sim101' Exchange=Default Price=12341.75 Quantity=1 Market position=Long Operation=Operation_Add Order='34490d9359d04b62b57bd513fdb8efe5' Time='12/10/2020 3:25 AM'
    12/10/2020 3:25 NinjaScript NinjaScript strategy 'STUBackTest/216100943' submitting order
    12/10/2020 3:25 Order Order='34490d9359d04b62b57bd513fdb8efe5/Sim101' Name='STUBackTest_LE_3-NQ 12-20' New state='Filled' Instrument='NQ 12-20' Action='Buy' Limit price=12341 Stop price=0 Quantity=3 Type='Market' Time in force=DAY Oco='' Filled=3 Fill price=12341.583333333334 Error='No error' Native error=''
    12/10/2020 3:25 Execution Execution='4e8f19bfdce24dc7995037a671d3d53a' Instrument='NQ 12-20' Account='Sim101' Exchange=Default Price=12341.5 Quantity=2 Market position=Long Operation=Operation_Add Order='34490d9359d04b62b57bd513fdb8efe5' Time='12/10/2020 3:25 AM'
    12/10/2020 3:25 Position Instrument='NQ 12-20' Account='Sim101' Average price=12341.5 Quantity=2 Market position=Long Operation=Operation_Add
    12/10/2020 3:25 Order Order='34490d9359d04b62b57bd513fdb8efe5/Sim101' Name='STUBackTest_LE_3-NQ 12-20' New state='Partially filled' Instrument='NQ 12-20' Action='Buy' Limit price=12341 Stop price=0 Quantity=3 Type='Market' Time in force=DAY Oco='' Filled=2 Fill price=12341.5 Error='No error' Native error=''
    12/10/2020 3:25 Order Order='34490d9359d04b62b57bd513fdb8efe5/Sim101' Name='STUBackTest_LE_3-NQ 12-20' New state='Working' Instrument='NQ 12-20' Action='Buy' Limit price=12341 Stop price=0 Quantity=3 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    12/10/2020 3:25 Order Order='34490d9359d04b62b57bd513fdb8efe5/Sim101' Name='STUBackTest_LE_3-NQ 12-20' New state='Accepted' Instrument='NQ 12-20' Action='Buy' Limit price=12341 Stop price=0 Quantity=3 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    12/10/2020 3:25 Order Order='34490d9359d04b62b57bd513fdb8efe5/Sim101' Name='STUBackTest_LE_3-NQ 12-20' New state='Submitted' Instrument='NQ 12-20' Action='Buy' Limit price=12341 Stop price=0 Quantity=3 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    12/10/2020 3:25 NinjaScript NinjaScript strategy 'STUBackTest/216100943' submitting order
    12/10/2020 3:24 DB Error on executing DB command: System.Data.SqlServerCe.SqlCeException (0x80004005): A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = FK__Strategy2Order__0000000000000403 ]
    12/10/2020 3:24 Execution Execution='dfc2ae33d36b423a8b178fee8229bef9' Instrument='NQ 12-20' Account='Sim101' Exchange=Default Price=12341.5 Quantity=4 Market position=Long Operation=Operation_Add Order='84840e188ecd46a3a529fa7840f48110' Time='12/10/2020 3:24 AM'
    12/10/2020 3:24 Position Instrument='NQ 12-20' Account='Sim101' Average price=0 Quantity=0 Market position=Flat Operation=Remove
    12/10/2020 3:24 Order Order='84840e188ecd46a3a529fa7840f48110/Sim101' Name='STUBackTest_SSL_8-NQ 12-20' New state='Filled' Instrument='NQ 12-20' Action='Buy to cover' Limit price=0 Stop price=12341.25 Quantity=4 Type='Stop Market' Time in force=DAY Oco='' Filled=4 Fill price=12341.5 Error='No error' Native error=''
    12/10/2020 3:24 Order Order='84840e188ecd46a3a529fa7840f48110/Sim101' Name='STUBackTest_SSL_8-NQ 12-20' New state='Working' Instrument='NQ 12-20' Action='Buy to cover' Limit price=0 Stop price=12341.25 Quantity=4 Type='Stop Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''

    #2
    Hello bjunaid,

    This error may be due to the NinjaTrader database file. We advise that you rename your database to resolve this item using the following steps :
    • Shutdown NinjaTrader and Go to the Start Menu
    • Select My Documents--> NinjaTrader 8--> db--> "NinjaTrader.sdf" file (may only say 'NinjaTrader' depending on your Windows File Explorer settings)
    • Right click on NinjaTrader.sdf and select "Rename"
    • *Name it "OLDNinjaTrader.sdf
    • Then restart the software and NinjaTrader will create a fresh database file to use
    Unfortunately the following items stored in the old database will be lost - Trading Hours templates, Instrument Lists / Custom Instruments, historical trade execution data, saved Strategy Analyzer backtest results

    Please let me know if the error persists after this procedure.
    Christopher J.NinjaTrader Customer Service

    Comment


      #3
      How can I backup my strategy back test results and templates?

      Will I lose my strategies as well?

      Comment


        #4
        Unfortunately there is not an option to backup the backtest results however this procedure add-on software such as strategies or chart templates. will not be removed.
        Christopher J.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by AttiM, 02-14-2024, 05:20 PM
        12 responses
        213 views
        0 likes
        Last Post DrakeiJosh  
        Started by cre8able, 02-11-2023, 05:43 PM
        3 responses
        238 views
        0 likes
        Last Post rhubear
        by rhubear
         
        Started by frslvr, 04-11-2024, 07:26 AM
        8 responses
        117 views
        1 like
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        10 responses
        47 views
        0 likes
        Last Post stafe
        by stafe
         
        Started by rocketman7, Today, 09:41 AM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X