Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

More than 100 User Events on Attach to indicator

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

    More than 100 User Events on Attach to indicator

    Hi

    I have an indicator that draws multiple plots on a chart.
    I manually enter an order with a no-trail stop and then manually attach the stop to one of the plots.
    This seems to work with most of the plots except one.

    When I attach it to the plot, I get
    " Error on calling 'OnOrderPriceChange' method: More than 100 subsequent user events"

    My code is an indicator and not a strategy and therefore does not call the "OnOrderPriceChange" method so I suspect that the error is being thrown by the attach to indicator code.

    Please help.

    Thx

    ps it is intermittent and seems only to happen with rapid price action ie. price moving very quickly
    Last edited by cnecorp; 05-21-2020, 10:04 AM.

    #2
    Hello cnecorp,

    Is OnOrderPriceChange a custom method?

    (This is not one documented in the help guide)

    Is this being triggered from a non-data-driven event like a timer or OnRender()?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello cnecorp,

      Is OnOrderPriceChange a custom method?

      (This is not one documented in the help guide)

      Is this being triggered from a non-data-driven event like a timer or OnRender()?
      Hi Chelsea
      It's not a custom method nor do I have a no data-driven-event that I am aware of and certainly do not have an OnRender in the indicator.
      Ed

      Comment


        #4
        Hello Ed,

        Thanks for confirming that. It may be something internal NinjaTrader is doing.

        With the indicator was is the Calculate setting set to in the Indicators window?

        Please send an email to platformsupport [at] ninjatrader [dot] com so that I may request the log and trace files.
        In the email please write refering to ticket 2567300.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello Ed,

          Thanks for confirming that. It may be something internal NinjaTrader is doing.

          With the indicator was is the Calculate setting set to in the Indicators window?

          Please send an email to platformsupport [at] ninjatrader [dot] com so that I may request the log and trace files.
          In the email please write refering to ticket 2567300.
          I am using calculate.oneachtick but its on a pretty grunty machine. I will send you an email as requested and attach the log and trace.

          Thanks
          Ed

          ROFL.
          Should have checked the the log.
          I am using a Draw.Region which uses on Render()

          This is the section in the log with the error

          2020-05-22 01:35:22:255|1|16|Indicator tracking price modification from '9370.00' to '9383.75'
          2020-05-22 01:35:22:256|1|32|Order='99eeb8f1e44240e5829d040b3 77c5930/Sim101' Name='' New state='Change submitted' Instrument='MNQ 06-20' Action='Sell' Limit price=0 Stop price=9383.75 Quantity=1 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
          2020-05-22 01:35:22:365|1|32|Order='99eeb8f1e44240e5829d040b3 77c5930/Sim101' Name='' New state='Accepted' Instrument='MNQ 06-20' Action='Sell' Limit price=0 Stop price=9383.75 Quantity=1 Type='Stop Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
          2020-05-22 01:36:04:924|3|4|Indicator '_sst01S01': Error on calling 'OnOrderPriceChange' method: More than 100 subsequent user events
          2020-05-22 01:36:05:222|3|16|Failed to call OnRender() for chart object 'Region': 'Object reference not set to an instance of an object.'
          2020-05-22 01:36:05:229|3|16|Failed to call OnRender() for chart object 'Region': 'Object reference not set to an instance of an object.'
          2020-05-22 01:36:05:229|3|16|Failed to call OnRender() for chart object 'Region': 'Object reference not set to an instance of an object.'
          2020-05-22 01:36:05:229|3|16|Failed to call OnRender() for chart object 'Region': 'Object reference not set to an instance of an object.'

          with similar errors in the trace

          020-05-22 01:35:22:365 (My NinjaTrader Continuum) Cbi.Account.OrderUpdateCallback: realOrderState=Accepted orderId='99eeb8f1e44240e5829d040b377c5930' account='Sim101' name='' orderState=Accepted instrument='MNQ 06-20' orderAction=Sell limitPrice=0 stopPrice=9383.75 quantity=1 orderType='Stop Market' filled=0 averageFillPrice=0 time='2020-05-22 01:35:22' statementDate='2020-05-22' error=NoError comment='' nr=-1
          2020-05-22 01:36:04:924 ERROR: Indicator '_sst01S01': Error on calling 'OnOrderPriceChange' method: More than 100 subsequent user events
          2020-05-22 01:36:05:222 ERROR: Failed to call OnRender() for chart object 'Region': 'Object reference not set to an instance of an object.'
          2020-05-22 01:36:05:228 ChartObject.Render.ERROR: Render exception on non finalized chart object 'NinjaTrader.NinjaScript.DrawingTools.Region' System.NullReferenceException: Object reference not set to an instance of an object.
          at NinjaTrader.NinjaScript.Series`1.get_Count()
          at NinjaTrader.NinjaScript.DrawingTools.Region.OnRend er(ChartControl chartControl, ChartScale chartScale)
          at NinjaTrader.Gui.Chart.ChartObject.Render(RenderTar get renderTarget, ChartControl chartControl, ChartScale chartScale)

          The error seems to trigger the draw region failure through.

          Will send the email and logs/trace


          Ed
          Last edited by cnecorp; 05-21-2020, 10:50 AM.

          Comment


            #6
            Hello Ed,

            Does this indicator collect volume or measure the number of ticks?

            Can this be used with Calculate On price change?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello Ed,

              Does this indicator collect volume or measure the number of ticks?

              Can this be used with Calculate On price change?

              Will change it to onpricechange and see if it addresses the problem, no real reason to be on each tick, just habit from my NT7 strategies.
              Just sent you the details regardless in case, might be useful to the Dev Team.



              Comment


                #8
                Originally posted by cnecorp View Post


                Will change it to onpricechange and see if it addresses the problem, no real reason to be on each tick, just habit from my NT7 strategies.
                Just sent you the details regardless in case, might be useful to the Dev Team.


                PriceChange seems to have fixed the problem.
                Thanks Chelsea

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                647 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                367 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                108 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                571 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                573 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X