Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Value of plots

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

    Value of plots

    Hello,

    I have developed an indicator that has two Plots with two colors (red and blue).

    So, I have used "ContainsValue" to check the state of my indicator and I can know wich of both colors are active.

    But this information is delayed one bar. For example, if the actual bar has my indicator with red color and I check ContainsValue, I get "false", but in the next bar, this value is "true".

    Why?

    And how can I to check the value of my indicator when I use two plots?

    Thanks in advance.

    #2
    Hello soyjesus,

    Thank you for writing in.

    What is your indicator's calculate on bar close property set to?

    With this set to true, any logic that you have within OnBarUpdate() will not display until the bar has closed, as OnBarUpdate() will only be called at the close of each bar. With it set to false, OnBarUpdate() is called on each tick that comes in and operates in real time.



    When using two plots, you can call the ContainsValue() method on each of the DataSeries object contained within the Values collection: https://ninjatrader.com/support/help...t7/?values.htm

    Example:
    Code:
    // first plot
    Values[0].ContainsValue(....);
    // second plot
    Values[1].ContainsValue(....);
    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    601 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    347 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    559 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    558 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X