• 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.

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.
    https://ninjatrader.com/support/help.../nt8/reset.htm
    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.
        https://ninjatrader.com/support/help...ddatapoint.htm
        https://ninjatrader.com/support/help...atapointat.htm
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ralett, Today, 11:28 AM
        0 responses
        1 view
        0 likes
        Last Post ralett
        by ralett
         
        Started by ChazJ, Today, 09:59 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Irukandji, Today, 09:34 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by lunardiplomacy, Today, 08:32 AM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by ralett, Today, 08:24 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Working...
        X