NexusFi: Find Your Edge


Home Menu

 





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 8,606 views
    2. thumb_up 8 thanks given
    3. group 4 followers
    1. forum 15 posts
    2. attach_file 1 attachments




 
Search this Thread

number of ticks in a bar/ms timestamp ?

  #1 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

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

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Deepmoney LLM
Elite Quantitative GenAI/LLM
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
36 thanks
NexusFi site changelog and issues/problem reporting
25 thanks
The Program
20 thanks
GFIs1 1 DAX trade per day journal
19 thanks
  #2 (permalink)
 
Saroj's Avatar
 Saroj 
Arcata, CA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: index futures, oil
Posts: 485 since Jun 2009
Thanks Given: 232
Thanks Received: 415


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
  #3 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,609 since Aug 2009
Thanks Given: 11,328
Thanks Received: 2,743


According to gomifromparis on the NT board
"NT has 1 second granularity in timestamps."

NinjaTrader Support Forum - View Single Post - [AUTOLINK]Delta[/AUTOLINK] 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
Thanked by:
  #4 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


DavidHP View Post
According to gomifromparis on the NT board
"NT has 1 second granularity in timestamps."

NinjaTrader Support Forum - View Single Post - [AUTOLINK]Delta[/AUTOLINK] 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
  #5 (permalink)
 
Saroj's Avatar
 Saroj 
Arcata, CA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: index futures, oil
Posts: 485 since Jun 2009
Thanks Given: 232
Thanks Received: 415

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:	274
Size:	69.3 KB
ID:	3372  
Reply With Quote
Thanked by:
  #6 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


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
  #7 (permalink)
jcash
Chicago
 
Posts: 2 since Jul 2009
Thanks Given: 2
Thanks Received: 0

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
  #8 (permalink)
 Prtester 
SE-Asia
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Amp
Trading: ES
Posts: 151 since Jun 2009
Thanks Given: 66
Thanks Received: 124


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
Thanked by:
  #9 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,173
Thanks Received: 101,538


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 the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
jcash
Chicago
 
Posts: 2 since Jul 2009
Thanks Given: 2
Thanks Received: 0


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




Last Updated on September 21, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts