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

IsValidDataPoint and IsValidDataPointAt throws exceptions

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

    IsValidDataPoint and IsValidDataPointAt throws exceptions

    Hi, it appears that IsValidDataPoint() and IsValidDataPointAt() breaks when it references an indicator that references a different timeframe.. this wasn't an issue in NT7.

    Attached is a sample custom strategy and corresponding indicator. The indicator references a separate timeframe.

    If these two methods fail at determining whether or not it is safe to read the data value, is there a viable alternative?
    Attached Files
    Jeremytang
    NinjaTrader Ecosystem Vendor - Shark Indicators

    #2
    Hello Jeremytang,

    Thanks for opening the thread.

    A hosted indicator that implements an additional data series will need to have that additional data series added to the hosting NinjaScript. If the strategy adds an indicator that implements an additional data series, then the strategy will need to add the data series as well.

    I do not see the additional data series added to the strategy in this example, and I am met with an error upon enabling the strategy mentioning the hosting NinjaScript does not add the data series that is being added by the indicator. When I add the data series to the strategy, IsValidDataPoint() checks are correct, and I see the plot values from the indicator printed.

    I've included a video demonstration - https://www.screencast.com/t/huFebnkGqi

    A note for adding additional data series in a hosting NinjaScript is listed in the AddDataSeries() page of the help guide.

    AddDataSeries() - https://ninjatrader.com/support/help...dataseries.htm

    If this information does not resolve your inquiry, could you give further detail on how you are setting up your test to hit the issue?

    I look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim, thanks for the info - I'll give this a shot.
      Jeremytang
      NinjaTrader Ecosystem Vendor - Shark Indicators

      Comment


        #4
        Usage

        What if you have 3 or more indicators nested?

        Obviously the lowest level one directly using the data series. But how about the rest?

        Example:
        Indicator A uses AddDataSeries to add data from a different symbol.
        Indicator B creates and references a Plot from Indicator A to create another plot or value, but does not use the data directly.
        Indicator C creates and references a plot or value from Indicator B to create yet another value.

        Do both B and C also need to do the identical AddDataSeries? Just B? Just C?

        Comment


          #5
          Welcome to the forums joshawa!

          You would only need to apply the AddDataSeries() to the top most NinjaScript and the script that uses the data series to avoid errors. Adding to the top most NinjaScript will make sure the data series is added before any data loading states occur.

          I would still recommend adding the AddDataSeries() call to any middle indicators that you use with your indicator that uses an additional data series so that middle indicator can be applied freely in other instances.

          Please let me know if you have any additional questions.
          JimNinjaTrader Customer Service

          Comment


            #6
            Thanks.

            About what I figured.

            I would recommend implementing another optional solution, perhaps an 'expert' solution to avoid these kinds of issues. For example, an Indicator parent/child graph relationship could track these dependencies and automatically register needed external symbols at the top parent and bottom child per your comment. I may implement something like this myself to ease development. My architecture is pretty deep.

            Comment


              #7
              Hello joshawa,

              Thanks for your feedback.

              We have a feature request tracking interest to remove the need for hosting NinjaScripts to AddDataSeries() for any child NinjaScripts. The ticket ID is SFT-2845, and I'll submit a vote on your behalf.

              As with other feature requests, we cannot present an ETA as they are fulfilled based on the development team's schedule and priorities. Upon implementation the ticket ID can be found publicly on the Release Notes page of the help guide. I'll provide a link below.

              Release Notes: https://ninjatrader.com/support/help...ease_notes.htm
              JimNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by gentlebenthebear, Today, 01:30 AM
              2 responses
              13 views
              0 likes
              Last Post gentlebenthebear  
              Started by Kaledus, Today, 01:29 PM
              2 responses
              7 views
              0 likes
              Last Post Kaledus
              by Kaledus
               
              Started by frankthearm, Yesterday, 09:08 AM
              13 responses
              45 views
              0 likes
              Last Post frankthearm  
              Started by PaulMohn, Today, 12:36 PM
              2 responses
              16 views
              0 likes
              Last Post PaulMohn  
              Started by Conceptzx, 10-11-2022, 06:38 AM
              2 responses
              56 views
              0 likes
              Last Post PhillT
              by PhillT
               
              Working...
              X