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 cre8able, Today, 01:16 PM
      2 responses
      9 views
      0 likes
      Last Post cre8able  
      Started by chbruno, 04-24-2024, 04:10 PM
      3 responses
      48 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by samish18, Today, 01:01 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by WHICKED, Today, 12:56 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by WHICKED, Today, 12:45 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X