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

Plot only in real time

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

    Plot only in real time

    I am trying to develop a simple indicator that plot a value only in real time data. I need that it doesn't be calculated on historical data. Working with NT7 the next lines of code worked properly to do that:

    protected override void OnBarUpdate()
    {
    if(Historical) return;

    Value[0] = (5);
    }

    But working with NT8 the "Historical" function does not exist. Please, could you tell me how to program this simple thing in NT8?

    Thanks in advance.



    #2
    Hello Plaket,

    Thank you for the question.

    When converting items from 7 to 8, I would suggest keeping the code breaking changes guide in mind: https://ninjatrader.com/support/help...ng_changes.htm

    The Historical property has been replaced with the State system and OnStateChange. When checking for historical bars in OnBarUpdate, that now looks like the following code:

    Code:
    if(State == State.Historical) return;


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    59 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Yesterday, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Yesterday, 07:39 PM
    0 responses
    7 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Yesterday, 03:01 PM
    2 responses
    22 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Yesterday, 07:24 PM
    0 responses
    10 views
    0 likes
    Last Post cre8able  
    Working...
    X