How can I get the current time and not the time of the bar's close?
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!
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
NinjaTrader
OnBarUpdate Time[0] is not updated real time with minute bars
Collapse
X
-
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?Tags: None
-
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.
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ageeholdings, Today, 07:43 AM
|
0 responses
7 views
0 likes
|
Last Post
by ageeholdings
Today, 07:43 AM
|
||
Started by pibrew, Today, 06:37 AM
|
0 responses
4 views
0 likes
|
Last Post
by pibrew
Today, 06:37 AM
|
||
Started by rbeckmann05, Yesterday, 06:48 PM
|
1 response
14 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
||
Started by llanqui, Today, 03:53 AM
|
0 responses
6 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
12 views
0 likes
|
Last Post Today, 12:38 AM |
Comment