Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Failed to execute DBJob OrderUpdateJob: Invalid Argument ?

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

    Failed to execute DBJob OrderUpdateJob: Invalid Argument ?

    Hello Support,

    My strategy was running fine with NT trail stop. I then add autobreakeven stop when first target is reached, everytime the strategy gets into positions, it generate multiple of the same errors "Failed to execute DBJob OrderUpdateJob: Invalid argument". The strategy does not crash.

    The autobreakeven stop feature modify the existing trailstop, and restore the initial stop settings when trade is closed.
    What is the cause of this? What can I do to fix it?

    Thanks.

    Regards.
    EdwardK

    #2
    Hello,

    Thanks for your note.

    Can you please give me an example of the code your using to set the trail stop and then the auto breakeven.

    Also, Can you please let me know what version of NinjaTrader you are using this is located in the Control Center under Help->About and is to the right of the NinjaTrader logo.


    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      Hello Brett,

      I am using 6.5.1000.19 Multibroker.

      Sample code:
      At initialize:
      SetTrailStop("Long1Q2",CalculationMode.Ticks, iStopTicks,useSimTS);

      at OnOrderUpdate when first target is reached:

      SetTrailStop("Long1Q2",CalculationMode.Ticks,FirstBreakEvenTicks,useSimTS);

      And when trailstop is cancelled or filled, setting is reset

      SetTrailStop("Long1Q2",CalculationMode.Ticks, iStopTicks,useSimTS);


      useSimTS is false in all instances.


      I now stop the strategy, and enter a position through the DOM and get another error message:
      Failed to execute DBjob 'StrategyUpdateJob': You cannot add or change a record because a related record is required in table 'nt_order' ?

      What is going on?

      Thanks.

      Regards.

      Comment


        #4
        Hello,

        Ok in this case I dont think this error is due to this change. Most likely you are having some database corruption.

        Please first try a database reprair. If the database repair does not resolve the issue please rename the database to allow NinjaTrader to create a new database.

        Follow the instructions below to repair the NinjaTrader database.
        • Disconnect NinjaTrader from any open connections via File > Disconnect
        • From the NinjaTrader Control Center window select the menu Tools > Options
        • Select the "Misc" tab
        • Press the "Repair DB" button
        • Press the "OK" button
        Restart NinjaTrader and let me know if you're able to get up and running after following those steps.


        This process will delete your saved ATM Strategies, Trade History and saved historical data.
        Can you please rename the NinjaTrader database. To rename the DB:
        • Shutdown NinjaTrader and Go to the Start Menu
        • Select My Documents--> NinjaTrader 6.5--> DB--> NinjaTrader.MDB.
        • Right click on NinjaTrader.MDB and select "Rename."
        • Name it "NewNinjaTrader.MDB."
        • Then restart the software.


        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment


          #5
          Hello Brett,

          This may not have anything to do with my Strategy.

          I shutdown NT and my computer. Restart computer and NT.

          Just entering at DOM generate the same errors.

          I am able to run my strategy without issue on another computer.

          I believe then there is some NT DB table errors somewhere on this computer.

          What is the painless way to resolve this ?

          Thanks.

          Comment


            #6
            Hello,

            Not sure if you saw my previous post before yours.

            I will post again:

            Hello,

            Ok in this case I dont think this error is due to this change. Most likely you are having some database corruption.

            Please first try a database reprair. If the database repair does not resolve the issue please rename the database to allow NinjaTrader to create a new database.

            Follow the instructions below to repair the NinjaTrader database.
            • Disconnect NinjaTrader from any open connections via File > Disconnect
            • From the NinjaTrader Control Center window select the menu Tools > Options
            • Select the "Misc" tab
            • Press the "Repair DB" button
            • Press the "OK" button
            Restart NinjaTrader and let me know if you're able to get up and running after following those steps.


            This process will delete your saved ATM Strategies, Trade History and saved historical data.
            Can you please rename the NinjaTrader database. To rename the DB:
            • Shutdown NinjaTrader and Go to the Start Menu
            • Select My Documents--> NinjaTrader 6.5--> DB--> NinjaTrader.MDB.
            • Right click on NinjaTrader.MDB and select "Rename."
            • Name it "NewNinjaTrader.MDB."
            • Then restart the software.


            Let me know if I can be of further assistance.
            __________________
            BrettNinjaTrader Product Management

            Comment


              #7
              When I get DBJob Orderupdatejob errors these are almost always caused by incorrect use of serialisation in my strategies.


              => question? Does the error persist when you remove all public properties from your strategy?


              regards
              andreas
              www.zweisteintrading.eu

              Comment


                #8
                Hello Brett,

                I did the DBrepair, it took quite a while, more than half hour.
                Restarting, the problem disappear, my strategy working ok.

                Thanks.

                Regards,

                EdwardK.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                627 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                359 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                562 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                568 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X