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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    173 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    90 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    129 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    208 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    186 views
    0 likes
    Last Post CarlTrading  
    Working...
    X