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

    Hello, My strategy mostly works ok. However it just missed an "ExitLong". Here is the error message 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 = 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()
    How can I fix this?

    Thanks,

    Evan

    #2
    It must be your strategy didnt work well.

    As you said you miss the exitlong.
    You must be make it execute so that your order will not be hang over there.

    Another important thing is cancel the order once you did not wish to carry out.

    Comment


      #3
      Hello evanp90,

      Thank you for the post.

      Could you provide more details on the use case where you see this error? The error presented is not a normal strategy based error, this can occur in some use cases though. There may be a general database corruption which can cause this error, also its possible that switching between live and replay connections using the same instance of a strategy would cause this. Generally removing the instance of the strategy and re applying it to the account is the solution.

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        Hello.
        I have the same issue in a strategy with unmanaged orders.
        fx.practic
        NinjaTrader Ecosystem Vendor - fx.practic

        Comment


          #5
          Hello fx.practic,

          As mentioned in the last post we would need details surrounding the scenario. The error can come up for various reasons and some of which would be expected like switching between live and replay using the same instance of the strategy. If you have more details surrounding when you see this and what the use case was we could go further into that with you.

          Please let me know if I may be of additional assistance.
          JesseNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by chbruno, 04-24-2024, 04:10 PM
          4 responses
          50 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by TraderG23, 12-08-2023, 07:56 AM
          10 responses
          398 views
          1 like
          Last Post beobast
          by beobast
           
          Started by lorem, Yesterday, 09:18 AM
          5 responses
          20 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by WHICKED, Today, 12:56 PM
          2 responses
          15 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by Felix Reichert, Today, 02:12 PM
          0 responses
          4 views
          0 likes
          Last Post Felix Reichert  
          Working...
          X