Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ageeholdings, Today, 07:43 AM
    0 responses
    7 views
    0 likes
    Last Post ageeholdings  
    Started by pibrew, Today, 06:37 AM
    0 responses
    4 views
    0 likes
    Last Post pibrew
    by pibrew
     
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    12 views
    0 likes
    Last Post burtoninlondon  
    Working...
    X