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 trilliantrader, 04-10-2024, 09:33 PM
    6 responses
    23 views
    0 likes
    Last Post trilliantrader  
    Started by traderqz, Today, 12:06 AM
    5 responses
    10 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Mongo, Today, 11:05 AM
    2 responses
    9 views
    0 likes
    Last Post Mongo
    by Mongo
     
    Started by guillembm, Today, 11:25 AM
    0 responses
    3 views
    0 likes
    Last Post guillembm  
    Started by Tim-c, Today, 10:58 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X