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

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 PaulMohn, Today, 03:49 AM
        0 responses
        7 views
        0 likes
        Last Post PaulMohn  
        Started by inanazsocial, Today, 01:15 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by rocketman7, Today, 02:12 AM
        0 responses
        10 views
        0 likes
        Last Post rocketman7  
        Started by dustydbayer, Today, 01:59 AM
        0 responses
        4 views
        0 likes
        Last Post dustydbayer  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        23 views
        0 likes
        Last Post trilliantrader  
        Working...
        X