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

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 kaywai, Today, 06:26 AM
    1 response
    6 views
    0 likes
    Last Post kaywai
    by kaywai
     
    Started by ct, 05-07-2023, 12:31 PM
    6 responses
    205 views
    0 likes
    Last Post wisconsinpat  
    Started by kevinenergy, 02-17-2023, 12:42 PM
    118 responses
    2,780 views
    1 like
    Last Post kevinenergy  
    Started by briansaul, Today, 05:31 AM
    0 responses
    10 views
    0 likes
    Last Post briansaul  
    Started by traderqz, Yesterday, 12:06 AM
    11 responses
    28 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X