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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    80 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X