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 wzgy0920, 04-20-2024, 06:09 PM
|
2 responses
26 views
0 likes
|
Last Post
by wzgy0920
Today, 10:43 PM
|
||
Started by wzgy0920, 02-22-2024, 01:11 AM
|
5 responses
32 views
0 likes
|
Last Post
by wzgy0920
Today, 10:33 PM
|
||
Started by wzgy0920, Yesterday, 09:53 PM
|
2 responses
49 views
0 likes
|
Last Post
by wzgy0920
Today, 10:29 PM
|
||
Started by Kensonprib, 04-28-2021, 10:11 AM
|
5 responses
191 views
0 likes
|
Last Post
by Hasadafa
Today, 10:19 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
11 responses
3,231 views
0 likes
|
Last Post Today, 08:07 PM |
Comment