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
NT8 acceessing time stamp when using calculation methid On Each Tick
Collapse
X
-
NT8 acceessing time stamp when using calculation methid On Each Tick
What is the best way to get the current timestamp when I have Calculate On each Tick selected. ie the exact time when that tick is processed, as we don't have a bar index to access it, or do we? -
Hello,
Thank you for the question.
For this, if you are only using 1 series, you could use OnMarketData to get the current ticks time stamps, Time[0] would refer to the Current bar which may or may not be a 1 tick series so that would not be accurate in this case when referring to only the current tick.
Otherwise you could also Add a 1 tick series and then get the Time[0] from the secondary series which would be the time of each tick.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
-
Originally posted by GKonheiser View PostWhat is the best way to get the current timestamp when I have Calculate On each Tick selected. ie the exact time when that tick is processed, as we don't have a bar index to access it, or do we?
Edit: This is only true if you are not using a time-delimited series. i.e., using Range bars, tick bars, renko or some such. I apologize. I am usually watching range bars, so had a brain poop on this one.Last edited by koganam; 11-25-2015, 12:55 PM.
Comment
-
So if mit primary bars are 10min bars but I have calculate on it tick set in ninja trader 8 there is no way of accessing the time stamp when it calculates without adding the tick time series ?
Comment
-
Hello,
I would suggest trying this question and Printing the time stamp, The print I received for a 10 minute series on each tick is:
protected override void OnBarUpdate()
{
Print(Time[0]);
}
11/25/2015 11:10:00 AM
11/25/2015 11:10:00 AM
11/25/2015 11:10:00 AM
11/25/2015 11:10:00 AM
11/25/2015 11:10:00 AM
11/25/2015 11:10:00 AM
or with milisecond:
protected override void OnBarUpdate()
{
Print(Time[0].ToString("MM/dd/yyyy hh:mm:ss.fff tt"));
}
11/25/2015 11:10:00.000 AM
11/25/2015 11:10:00.000 AM
11/25/2015 11:10:00.000 AM
11/25/2015 11:10:00.000 AM
11/25/2015 11:10:00.000 AMJesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by traderqz, Today, 12:06 AM
|
6 responses
12 views
0 likes
|
Last Post
by traderqz
Today, 12:17 PM
|
||
Started by Skifree, Today, 03:41 AM
|
3 responses
12 views
0 likes
|
Last Post
by Skifree
Today, 12:03 PM
|
||
Started by traderqz, Yesterday, 09:06 AM
|
5 responses
33 views
0 likes
|
Last Post Today, 12:03 PM | ||
Started by guillembm, Today, 11:25 AM
|
1 response
6 views
0 likes
|
Last Post Today, 12:01 PM | ||
Started by owensd, 04-21-2024, 11:34 PM
|
9 responses
34 views
0 likes
|
Last Post Today, 11:59 AM |
Comment