Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing Custom Series within OnRender

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

    Accessing Custom Series within OnRender

    Most of my tools rely upon setting a value for a Series on a bar by bar basis, and then accessing that Series within OnRender to draw it on the chart.

    I was away for a while. Came back to NT and installed the newest version of NT8, and now all of my indicators are broken.

    It seems that OnRender() is called in a such a way that I can only access Series values for the first bar on the chart.

    For instance, if within OnRender() I add:

    Print(High[0]);

    I will not see the high of the current bar on the chart, but the high of the first bar on the chart.

    #2
    Hello,
    In NinjaTrader 8 if you are needing the call the value of a DataSeries such as High outside of OnBarUpdate() you would need to use the Absolute Index which is called using .GetValueAt()
    To call High[0] inside OnRender() you would use High.GetValueAt(CurrentBar-1)

    For more information on .GetValueAt() please see the following link: http://ninjatrader.com/support/helpG...getvalueat.htm
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      It's weird that my indicators used to work without using GetValueAt back on 8.0.0.10. I was able to fix those old NT8 indicators with a Find and Replace, though, so I'm ready for tomorrow morning.

      Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bortz, 11-06-2023, 08:04 AM
      47 responses
      1,609 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      9 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      19 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      6 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      16 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X