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 f.saeidi, Today, 12:14 PM
          7 responses
          16 views
          0 likes
          Last Post f.saeidi  
          Started by Russ Moreland, Today, 12:54 PM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by philmg, Today, 12:55 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Started by TradeForge, 04-19-2024, 02:09 AM
          2 responses
          32 views
          0 likes
          Last Post TradeForge  
          Started by aprilfool, 12-03-2022, 03:01 PM
          3 responses
          329 views
          0 likes
          Last Post NinjaTrader_Adrian  
          Working...
          X