Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

'OnOrderUpdate' method error - more than 100 subsequent user events

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

    'OnOrderUpdate' method error - more than 100 subsequent user events

    I have never seen this error message before:
    **NT** Error on calling 'OnOrderUpdate' method for strategy 'ChaosHunterStrategy/566ac974c5b34e7fb8490d498a5c85e6': More than 100 subsequent user events

    Any ideas as to what I should be looking for.

    Thanks,

    John

    #2
    Hello scjohn,

    This message typically is given when a repeated number of methods/functions are called in succession and stack up before NinjaTrader can process them all.

    Are you using any Custom Events or external methods?

    JCNinjaTrader Customer Service

    Comment


      #3
      My bad. I caused an endless loop OnOrderUpdate method.

      Comment


        #4
        Hello John,

        Thank you for your update.

        I am glad you were able to resolve this matter.

        Please let us know if we may be of further assistance.

        Comment


          #5
          Hi There,

          I just ran into this as well. A simple way to re-create this scenario is to put a SetStoploss() into the OnOrderUpdate method, where the Order update sets a new stop loss and SetStopLoss triggers another OnOrderUpdate which triggers another SetStopLoss and so the loop continues...

          Way around this - set a price variable in the OnOrderUpdate Method based on order.stopprice or order.limitprice and pick that variable up in the OnBarUpdate Method where you can then call SetStopLoss() to actually change the stop/target.

          Kind Regards
          Frank

          Comment


            #6
            Hello Frank,

            A stop loss is an order and modifying it will cause OrderUpdates to occur. There wouldn't be anything stopping you from updating an active stop loss from OnOrderUpdate, you would just have to be sure that your OnOrderUpdate logic is restrictive enough to only update the stop loss on say: OrderUpdates of other orders, within specific OrderStates.

            JimNinjaTrader 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