Trading Articles
Article Categories
Article Tools
number of ticks in a bar/ms timestamp ?
Updated September 21, 2012
Top Posters
looks_one
sam028
with 3 posts (0 thanks)
looks_two
Prtester
with 2 posts (2 thanks)
looks_3
Saroj
with 2 posts (2 thanks)
looks_4
RJay
with 2 posts (2 thanks)
Best Posters
looks_one
RJay
with 1 thanks per post
looks_two
Saroj
with 1 thanks per post
looks_3
Prtester
with 1 thanks per post
looks_4
DavidHP
with 1 thanks per post
trending_up
6,976 views
thumb_up
8 thanks given
group
4 followers
forum
15 posts
attach_file
1 attachments
Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free and simple.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
number of ticks in a bar/ms timestamp ?
(login for full post details)
#1 (permalink )
Site Moderator
Posts: 3,665 since Jun 2009
Thanks: 3,786 given,
4,494
received
Two different questions...
1/ I'm looking for an indicator which will able to show how many ticks we had in a min/vol /range bar.
I think I can write it, but if it's already done somewhere, I'll take it .
2/ I'm trying to store, with ZenFire datafeed and NT, tick data with a milli-second timestamp. AFAIK, I can write an indicator which is writing a line after each tick, but the timestamp will be the computer time, not the transaction time right ?
I think the best way to do this is do directly use ZF API, but I'll be happy if someone can confirm this.
Thx.
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#2 (permalink )
Arcata, CA
Experience: Intermediate
Platform: NinjaTrader
Trading: index futures, oil
Posts: 486 since Jun 2009
Thanks: 232 given,
413
received
sam028
Two different questions...
1/ I'm looking for an indicator which will able to show how many ticks we had in a min/
vol /range bar.
I think I can write it, but if it's already done somewhere, I'll take it
.
2/ I'm trying to store, with ZenFire datafeed and NT, tick data with a milli-second timestamp. AFAIK, I can write an indicator which is writing a line after each tick, but the timestamp will be the computer time, not the transaction time right ?
I think the best way to do this is do directly use ZF API, but I'll be happy if someone can confirm this.
Thx.
sam, I'm just starting to explore time in NS/C# so may be totally off topic here... but I changed my computer time ... both the hour and minute... I'm displaying Time[0] in an output window and it is continuing to show a bar time that is consistent with the chart (which is different from my current computer time)... I notice that it disconnects and reconnects to zenfire after I change the time which I suspect is a sync up situation... as far as milli seconds... no idea... it only displays seconds in the output window. I did notice that NT Josh says Time[0] returns the DateTime timestamp of the bar, let alone a "tick".
Are you trying to replicate the market replay data? or is that compressed in some way? Have you tried to determine its data structure?
(login for full post details)
#3 (permalink )
New Orleans, La (Mardi Gras City)
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Posts: 1,348 since Aug 2009
Thanks: 9,463 given,
2,360
received
According to gomifromparis on the NT board
"NT has 1 second granularity in timestamps."
NinjaTrader Support Forum - View Single Post - Delta Buy/Sell Volume
I've not personally verified this but this guy produces some pretty good indicators and seems to know a lot about NT.
Hope this helps.
The following user says Thank You to DavidHP for this post:
(login for full post details)
#4 (permalink )
Site Moderator
Posts: 3,665 since Jun 2009
Thanks: 3,786 given,
4,494
received
DavidHP
Right, I've read this before, Ninja is 1sec min granularity. The solution may be to use the ZenFire API, but I didn't already played with it, that was I'm looking for.
Another way, I'm testing it now, is getting the current time, with ms precision, after each tick, but it's not really what the best way to do it.
I'm trying to play with the duration between two ticks, to see if this information can be useful or not.
(login for full post details)
#5 (permalink )
Arcata, CA
Experience: Intermediate
Platform: NinjaTrader
Trading: index futures, oil
Posts: 486 since Jun 2009
Thanks: 232 given,
413
received
sam, you've probably found this already, but I just came across it... p487 of NinjaTraderVersion6HelpGuide.pdf on C3 Method (Functions) Reference
The following 2 users say Thank You to Saroj for this post:
(login for full post details)
#6 (permalink )
Site Moderator
Posts: 3,665 since Jun 2009
Thanks: 3,786 given,
4,494
received
Saroj
sam, you've probably found this already, but I just came across it... p487 of NinjaTraderVersion6HelpGuide.pdf on C3 Method (Functions) Reference
Thx, I didn't see this, but I'm using something similar:
Code
protected override void OnBarUpdate () { string myTime = DateTime . Now . ToString ( "HH:mm:ss:ffff" ); ...
Like I wrote it before, this is not the best solution, I'll like to have what the datafeed provider really sent to Ninja (the tape with ms timestamp), but it's enough for a first approach. And it's interesting to see how many ticks/second can be managed by NT (my first tests show that 30 ticks/seconds is fine).
(login for full post details)
#7 (permalink )
Chicago
Posts: 2 since Jul 2009
Thanks: 2 given,
0
received
i have been able to measure time between ticks down to the ms using stopwatch in C#.
has anyone been able to get actual timestamps through the zen fire API?
(login for full post details)
#8 (permalink )
SE-Asia
Experience: Intermediate
Platform: NinjaTrader
Broker: Amp
Trading: ES
Posts: 148 since Jun 2009
Thanks: 64 given,
122
received
sam028
Thx, I didn't see this, but I'm using something similar:
Code
protected override void OnBarUpdate () {
string myTime = DateTime . Now . ToString ( "HH:mm:ss:ffff" );
...
Like I wrote it before, this is not the best solution, I'll like to have what the datafeed provider really sent to Ninja (the
tape with ms timestamp), but it's enough for a first approach. And it's interesting to see how many ticks/second can be managed by NT (my first tests show that 30 ticks/seconds is fine).
Did you try DateTime.Now.Ticks
The following user says Thank You to Prtester for this post:
(login for full post details)
#9 (permalink )
Site Administrator Swing Trader Data Scientist & DevOps
Manta, Ecuador
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
Posts: 49,764 since Jun 2009
Thanks: 32,302 given,
97,534
received
jcash
i have been able to measure time between ticks down to the ms using stopwatch in C#.
has anyone been able to get actual timestamps through the zen fire API?
Use OnMarketData and then use e.Time for the data feed timestamp.
Mike
(login for full post details)
#10 (permalink )
Chicago
Posts: 2 since Jul 2009
Thanks: 2 given,
0
received
e.Time.ToString("HH:mm:ss:ffff") in OnMarketData is giving me NT's rounded timestamp:
Last Price: 641.3 Last Time: 12:56:04:0000
(login for full post details)
#11 (permalink )
SE-Asia
Experience: Intermediate
Platform: NinjaTrader
Broker: Amp
Trading: ES
Posts: 148 since Jun 2009
Thanks: 64 given,
122
received
jcash
e.Time.ToString("HH:mm:ss:ffff") in OnMarketData is giving me NT's rounded timestamp:
Last Price: 641.3 Last Time: 12:56:04:0000
if you want more than seconds, ex milliseconds, you can't use NT Timestamp, you should make your own time for each incoming tick,
myticktime = DateTime.Now.Ticks;
then you need to convert it to the unit you will use.
Hope that help
The following user says Thank You to Prtester for this post:
(login for full post details)
#12 (permalink )
Hartford, CT. USA
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 688 since Jun 2009
Thanks: 747 given,
780
received
jcash
e.Time.ToString("HH:mm:ss:ffff") in OnMarketData is giving me NT's rounded timestamp:
Last Price: 641.3 Last Time: 12:56:04:0000
jcash,
I use my cpu to time stamp each incoming tick to the microsecond.
I use something like this:
private string format = "HH.mm:ss.ffffff";
Try using a period instead of a colon between "ss" and "ffff"
RJay
The following 2 users say Thank You to RJay for this post:
(login for full post details)
#13 (permalink )
Hartford, CT. USA
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 688 since Jun 2009
Thanks: 747 given,
780
received
(login for full post details)
#14 (permalink )
Houston,Tx
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,302 since Feb 2010
Thanks: 1,206 given,
4,332
received
RJay
jcash,
I use my cpu to time stamp each incoming tick to the microsecond.
I use something like this:
private string format = "HH.mm:ss.ffffff";
Try using a period instead of a colon between "ss" and "ffff"
RJay
@RJay
Does that prevent NT changing tick bars after a chart refresh?
I use Zenfire. Today I refreshed a chart with Momentum bars and the bars changed significantly.
I was told DTN has their own timestamp with granularity more than a second . Does NT record that or round it off?
Sorry for the But bars changing during a session really bothers me.
I'm just a simple man trading a simple plan.
My daddy always said, "Every day above ground is a good day!"
(login for full post details)
#15 (permalink )
Houston,Tx
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,302 since Feb 2010
Thanks: 1,206 given,
4,332
received
Got part of my answer from NT support ....
NinjaTrader_Joydeep
Hello ThatManFromTexas,
The highest granulation time frame which
NinjaTrader currently offers is upto second. NinjaTrader will round it off to the second even if your data feed provides say milliseconds granularity. Our next major release however is expected to support higher granularity than seconds.
I'm just a simple man trading a simple plan.
My daddy always said, "Every day above ground is a good day!"
(login for full post details)
#16 (permalink )
Galveston ,TX
Experience: Intermediate
Platform: NT7
Broker: Zaner
Trading: Futures
Posts: 386 since Mar 2010
Thanks: 364 given,
433
received
adding precision to the timestamp will solve so many issues with respect to historical/backtest ... looking forward to NT8!
cheers,
-e
The following user says Thank You to eman for this post:
Last Updated on September 21, 2012
Right now
Ongoing
Coming soon
March
Register to Attend
Elite only
Register to Attend
Elite only
Right now
April