• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.


No announcement yet.

Partner 728x90


NT8 V12 indicator error when V11 was fine

  • Filter
  • Time
  • Show
Clear All
new posts

    NT8 V12 indicator error when V11 was fine

    Like others I have upgraded to Beta version 12 of NT8.
    I have a couple of indicators that call other indicators and uses multi time frames.

    They were working fine in V11 but now I receive this error from a try/catch output around the code I have found to be the culprit. (This error comes up on a lot of the bars but I do get some results from my indicator using a 'Print' output, so it's not all errors. There are results and errors together in the output)

    15-Jul-16 3:59:55 PM System.ArgumentOutOfRangeException: 'barsAgo' needed to be between 0 and -1 but was 0
    Parameter name: barsAgo
    at NinjaTrader.NinjaScript.Series`1.IsValidDataPoint( Int32 barsAgo)
    at NinjaTrader.NinjaScript.Indicators.aAaTestsinewave .OnBarUpdate()
    This is the error in the output window without try/catch.
    Error on calling 'OnBarUpdate' method on bar 189: Object reference not set to an instance of an object.
    In the try/catch output, it says there is an out of range exception 'barsAgo'. In my code I'm calling another indicator and checking that there is a ValidDataPoint(0) and it's the current bar (0) I'm after. The error says it needs between 0 and -1, well I have 0. So I'm a bit lost on this one.

    I've been trying to sort this for a day now and am just wondering if a NT guru can shed some light on this? It's most likely something I need to update or change for V12 but as I'm a bit lost with it, knowing if it's the V12 or me would be helpful.
    I've looked through the release notes but can't see anything that I could relate to my problem. http://ninjatrader.com/support/helpG...ease_notes.htm

    Thanks in advance.
    Last edited by fling_wing; 07-16-2016, 04:15 AM.

    Hello fling_wing, and thank you for your report.

    Would it be possible to provide us with a stripped down code sample, in which you call built-in indicators as your sub-indicators, in which this behavior is reproduced on your end? This will enable us to have a complete picture of what is occurring.
    Jessica P.NinjaTrader Customer Service


      Hi Jessica,
      Will do. Have to build something and then email you. What's the support number you would like me to add in the email?


        Thank you, I appreciate it. Please include this number in the body of your e-mail to [email protected] : 1544893
        Jessica P.NinjaTrader Customer Service


          Email sent with indicator attached.


            Hello fling_wing, and thank you for providing that code sample.

            After careful review, it appears the vendor of the third party indicator you are using will need to update their code, so that its sub-class does not have any initialization done outside of their indicator's OnStateChange method where State == State.Configure . I recommend they pass an instance of their indicator (retrieved with "this") down to their sub-classed indicator.

            If this advice is off base, please let them know they can contact us directly at platformsupport[at]ninjatrader[dot]com , referencing this unique ID number in the body of their e-mail :


            Please let us know if there are any other ways we can help.
            Jessica P.NinjaTrader Customer Service


              Thanks, Jessica. I'll pass this information on to the vendor.

              Out of interest. What changed within Beta 12 to make this error show up when it was all fine in Beta 11?


                While I can not be positive without extensive testing of the third party indicator, these fixes from the release notes page for beta 12 could possibly have had an effect.

                • Strategy Wizard did not utilize secondary series for input correctly. Note: This fixed resulted in change which preventing "Plot on chart" from working correctly, which is schedule to be fixed in the next beta release (# 10090)
                • Multi-series indicator was running into deadlocks
                • Tick Replay sometimes caused SynchronizationLockException when loading indicator
                • Exception in multi-series Playback

                Generally speaking, this seems related to the way Series objects are being initialized in other objects (e.g. strategies, indicators) created by strategies.
                Jessica P.NinjaTrader Customer Service


                Latest Posts


                Topics Statistics Last Post
                Started by swcooke, Today, 12:33 PM
                1 response
                Last Post NinjaTrader_ChelseaB  
                Started by NinjaCustomer, Today, 12:10 PM
                2 responses
                Last Post NinjaCustomer  
                Started by KINGKODA, Today, 11:48 AM
                0 responses
                Last Post KINGKODA  
                Started by mlarocco, Today, 10:52 AM
                6 responses
                Last Post mlarocco  
                Started by Eros Lima, Today, 09:45 AM
                2 responses
                Last Post NinjaTrader_ChrisL