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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    70 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    152 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X