Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing plot values

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

    Accessing plot values

    Hello, i have an indicator A which exposes some plots to be used in another indicator.

    I have a couple of scenarios where after setting the values of the Plot values made public in onbarupdate - i need to then go back and change and sometimes reset those values,
    So i iterate backwards through the series until i reach 0.

    If another indicator B which references this indicator A and uses the exposed plot values to either draw something - how will this indicator B be affected if the plot values have been changed?
    If the indicator B is using onrender then i presume there would be immediate change in the drawing rendering perhaps if is using these exposed plots from indicator A.
    If Indicator B is just using the drawing in onbarupdate then there would be no appearance of change in the plot values from indicator A ?

    What i would like to do is somehow invalidate the plots from A in certain situations so that any indicator accessing the indicator A plots - cannot do so either in onRender or in onbarupdate.
    Just wondering if there is a trick or approach to this

    thanks

    #2
    Hello explorer101,

    Changing plot values on past bars would change the rendered plot on the chart but it is not going to cause OnBarUpdate() to trigger again for that bar in either script.

    If you are using the values from the plot of indicator A in indicator B in OnBarUpdate(), then you would need to loop through indicator A's series and recalculate every value and set this to that bar index for the series in indicator B.

    It comes down to how that series from indicator A is being used. If you are looping through it, thats fine. If you aren't looping through it you are not going to see any changes in indicator B.

    If you want the series from indicator A to be unusable, you can use the Series.Reset() method to remove the value.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      thanks Chelsea appreciate the response. I will test the Reset() method. Presumably it is good practice to use the IsValidDataPoint() when accessing a plot series exposed from another indicator?

      thanks

      Comment


        #4
        Hello explorer101,

        Yes, the Series.IsValidDataPoint()/IsValidDataPointAt() allows you to know if a value has been set for that bar index in the series.

        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X