Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Should I use `update()` with plot dataseries?

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

    Should I use `update()` with plot dataseries?

    Hi.
    lets say in custom indicator, we have plot dataseries:

    Code:
            #region Properties
            [Browsable(false)]	
            [XmlIgnore()]		
            public DataSeries Bullish_upper_Line
            {
                get {  [COLOR="Red"]Update(); [/COLOR] return Values[0]; }
            }
     
            ......
    when we call this indi from another strategy/indi, should we need to have that red "update()" or it is not needed at all?
    If that member was not plot, then we have to update?

    my main confusion is that, when we have to use `update`..

    p.s. I have read the article "exposing values that are not plots" already, just wanted to make sure in this.

    p.s.2 it's good, you have included this hint also in that article.

    #2
    Hello,

    Thank you for the question.

    In this situation the help guide comment provides some clarity on this item:

    This method is only relevant in specific use cases and likely only used by advanced programmers
    You will very likely not need to use this except for very specific situations, for setting a plot you won't need this.



    In the case of the help guide example, we can see a public double is used which is not a Plot, this would require using Update to ensure the value is calculated when this public property is called. You can also see this used in indicators that rewrite historical values or expose custom methods like the ZigZag indicator. The ZigZag has methods to retrieve a value similar to the help guide example which requires Update to be called to ensure OnBarUpdate is run.

    For plots, where you return the Values collection, these do not generally need to have Update() syntax. Again only in very specific situations, this would be needed, the ZigZag is a good example of this.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    331 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
    549 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    549 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X