Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Log shows "DB" error when running strategy

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

    Log shows "DB" error when running strategy

    Hello guys,

    Im getting this messages on the log, after I enable my own strategy. Can you please guide me to understand whats wrong? Category "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 ] 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.Execution.DbAdd() at NinjaTrader.Cbi.DB.DBThread()

    #2
    Hello facuevasm,

    This is a database error. Could have trouble pulling previously submitted executions for this strategy instance.

    Please ensure you are updated to 8.0.26.1.
    Click here to download NinjaTrader

    Reset the database.


    Remove the instance of the strategy from the chart or Strategies tab of the Control Center and add a new instance.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea! I have the last version of Ninja, and I also reset the database, and loaded a fresh strategy on a new chart, but Im still watching this messages in the log.
      The problem comes when I load my strategy on the chart.....

      Please find attached the messages that appear on the log today.. Let me know what could be the problem.

      Thank you!
      Attached Files

      Comment


        #4
        Hello facuevasm,

        Are you able to reproduce this error adding a new instance of the SampleMACrossover included with NinjaTrader?

        Copy the script to a test script and remove all code that can be removed while still being able to reproduce the error.

        Then export the reduced copy and attach to your next post so that I may test. Please ensure you have removed all code that can be removed.

        To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
        1. Click Tools -> Export -> NinjaScript...
        2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
        3. Click the 'Export' button
        4. Enter a unique name for the file in the value for 'File name:'
        5. Choose a save location -> click Save
        6. Click OK to clear the export location message
        By default your exported file will be in the following location:
        • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
        Below is a link to the help guide on Exporting NinjaScripts.
        http://ninjatrader.com/support/helpG...-us/export.htm
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        58 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        133 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X