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 sjsj2732, 03-23-2026, 04:31 AM
    0 responses
    78 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    313 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    319 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    149 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    115 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X