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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    44 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    58 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    35 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    95 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    59 views
    0 likes
    Last Post PaulMohn  
    Working...
    X