number of ticks in a bar/ms timestamp ? - futures io
futures io futures trading



number of ticks in a bar/ms timestamp ?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one sam028 with 3 posts (0 thanks)
    2. looks_two Prtester with 2 posts (2 thanks)
    3. looks_3 Saroj with 2 posts (2 thanks)
    4. looks_4 RJay with 2 posts (2 thanks)
      Best Posters
    1. looks_one RJay with 1 thanks per post
    2. looks_two Saroj with 1 thanks per post
    3. looks_3 Prtester with 1 thanks per post
    4. looks_4 DavidHP with 1 thanks per post
    1. trending_up 6,976 views
    2. thumb_up 8 thanks given
    3. group 4 followers
    1. forum 15 posts
    2. 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)

 
Search this Thread
 

number of ticks in a bar/ms timestamp ?

(login for full post details)
  #1 (permalink)
Site Moderator
 
 
sam028's Avatar
 
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.

Follow me on Twitter Started this thread Reply With Quote

Journal Challenge February 2021 results:
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(173 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(120 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(35 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #2 (permalink)
Arcata, CA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: index futures, oil
 
Saroj's Avatar
 
Posts: 486 since Jun 2009
Thanks: 232 given, 413 received


sam028 View Post
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?

Reply With Quote
 
(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
 
DavidHP's Avatar
 
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.

Follow me on Twitter Reply With Quote
The following user says Thank You to DavidHP for this post:
 
(login for full post details)
  #4 (permalink)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,665 since Jun 2009
Thanks: 3,786 given, 4,494 received


DavidHP View Post
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.

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.

Follow me on Twitter Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
Arcata, CA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: index futures, oil
 
Saroj's Avatar
 
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

Attached Thumbnails
Click image for larger version

Name:	System DateTime reference.png
Views:	128
Size:	69.3 KB
ID:	3372  
Reply With Quote
The following 2 users say Thank You to Saroj for this post:
 
(login for full post details)
  #6 (permalink)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,665 since Jun 2009
Thanks: 3,786 given, 4,494 received


Saroj View Post
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).

Follow me on Twitter Started this thread Reply With Quote
 
(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?

Reply With Quote
 
(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 View Post
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

Reply With Quote
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
 
Big Mike's Avatar
 
Posts: 49,764 since Jun 2009
Thanks: 32,302 given, 97,534 received


jcash View Post
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

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(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

Reply With Quote
 
(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 View Post
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

Reply With Quote
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
 
RJay's Avatar
 
Posts: 688 since Jun 2009
Thanks: 747 given, 780 received


jcash View Post
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

Reply With Quote
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
 
RJay's Avatar
 
Posts: 688 since Jun 2009
Thanks: 747 given, 780 received

Has anyone cracked the Zen-Fire Micro time stamp access problem??



here are some links.



uint32_t zenfire::tick::tick_t::usec

https://www.hugedomains.com/domain_profile.cfm?d=zen-fire&e=com

https://www.hugedomains.com/domain_profile.cfm?d=zen-fire&e=com


Thanks,


RJay

Reply With Quote
 
(login for full post details)
  #14 (permalink)
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,206 given, 4,332 received


RJay View Post
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!"
Reply With Quote
 
(login for full post details)
  #15 (permalink)
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,206 given, 4,332 received

Got part of my answer from NT support ....


NinjaTrader_Joydeep View Post
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!"
Reply With Quote
 
(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

Reply With Quote
The following user says Thank You to eman for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > number of ticks in a bar/ms timestamp ?


Last Updated on September 21, 2012


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

New Challenge (TBD)

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts