Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    649 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    576 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X