Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarUpdate Time[0] is not updated real time with minute bars

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

    OnBarUpdate Time[0] is not updated real time with minute bars

    I just noticed this: when using minute bars & calculate on bar close = false, the Time[0] variable is always set to the value the minute bar will have when it closes. it's not updated real time. Is this by design?

    How can I get the current time and not the time of the bar's close?

    #2
    Hello,

    This is by design. NinjaTrader can only run on historical data on the close time stamps of the bars. As NinjaTrader knows no other data points of which to run from.

    Therefor this is expected when running with Time[0] and especially expected with historical data.

    However if your running a live only strategy(live data flowing in), you can get the system clock time in c# using DateTime.Now or any DateTime functions which are described on the MSDN microsoft coding page. This will not relate in any ways to your bars however it will simply get the current PC clock time and you can use this in some fashion.

    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    42 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    25 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    162 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    98 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    157 views
    2 likes
    Last Post CaptainJack  
    Working...
    X