NexusFi: Find Your Edge


Home Menu

 





Using OnMarketData() on Historical data with a recording engine


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one gomi with 34 posts (87 thanks)
    2. looks_two aviat72 with 10 posts (2 thanks)
    3. looks_3 danjurgens with 9 posts (3 thanks)
    4. looks_4 Michael.H with 8 posts (0 thanks)
      Best Posters
    1. looks_one gomi with 2.6 thanks per post
    2. looks_two Zondor with 1 thanks per post
    3. looks_3 danjurgens with 0.3 thanks per post
    4. looks_4 aviat72 with 0.2 thanks per post
    1. trending_up 50,482 views
    2. thumb_up 104 thanks given
    3. group 28 followers
    1. forum 115 posts
    2. attach_file 23 attachments




 
Search this Thread

Using OnMarketData() on Historical data with a recording engine

  #31 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505

Here's a new version of the Recorder.

Added

File Formats


* Ability to read directy QCollector , QCollectorIQ and IRT files
* Millisec format, which will try to use the current clock to record millisecond timestamps. The recorder will try to adapt the lag between the exchange and the PC to keep timestamps matched (see for an indy that monitors the lag). And thanks Zondor, there was indeed a bug ;-)

Methods

Added GomOnBarUpdateDone method to allow better performance.

So now the whenever OnBarUpdate is called on the indicator, it calls first GomOnBarUpdate, then it does its internal stuff like reading Gom files, and when everything is finished it calls GomOnBarUpdateDone

Ideally, you should put in GomOnBarUpdate the code thas is used to initialize each new bar, then in GomOnMarketData the code that updates your own data objects, and in GomOnBarUpdateDone the code that plots your internal objects by setting values to time series.

See enclosed GomDeltaVolume to see example implementation.

Attached Thumbnails
Click image for larger version

Name:	millisec.png
Views:	512
Size:	39.2 KB
ID:	15178  
Attached Files
Elite Membership required to download: GomRecorderIndicator.cs
Elite Membership required to download: GomDeltaVolume.cs
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Are there any eval firms that allow you to sink to your …
Traders Hideout
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
Battlestations: Show us your trading desks!
24 thanks
The Program
18 thanks
  #32 (permalink)
 zikonc 
san ramon
 
Experience: Beginner
Platform: ninja
Broker: zen
Trading: es, 6e
Posts: 136 since Oct 2009
Thanks Given: 98
Thanks Received: 76


gomi View Post

So now the whenever OnBarUpdate is called on the indicator, it calls first GomOnBarUpdate, then it does its internal stuff like reading Gom files, and when everything is finished it calls GomOnBarUpdateDone.

Hi Gomi, would you say that this new function GomOnBarUpdateDone would help VolumeLadder?.......if so, perhaps you can tell us where in the code you would add it ...... thanks a bunch .....

Reply With Quote
  #33 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505


no the ladder uses it own plot methods. It's more for indicators that use standard plotting methods and Ninja dataseries.

The problem is that if you put your plotting code in GomOnMarketData you will end plotting too often. So it's best to put it in GomOnBarUpdateDone.

Started this thread Reply With Quote
Thanked by:
  #34 (permalink)
 Michael.H 
CA
 
Experience: Master
Platform: Marketdelta and Ninja
Broker: Velocity
Trading: NQ
Posts: 663 since Apr 2010
Thanks Given: 64
Thanks Received: 529

my chart doesn't say gom millisecond recorder on it. Im not using the delta volume indicator, just the gom cd. I know before you didn't have to actually load the volume recorder on the chart, but do you have to on this one?

Reply With Quote
  #35 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505

no, but did you launch a recompilation using F5 on any indicator ?

Started this thread Reply With Quote
  #36 (permalink)
 rsi77 
Chicago
 
Experience: Intermediate
Platform: Ninja Trader & TradeStation
Broker: Amp Futures/Zen-Fire
Trading: ES
Posts: 56 since Jun 2009
Thanks Given: 17
Thanks Received: 48

Hi Gomi,
Will new indicators need to be written or updated for this recorder, or will the current GOM package benefit from this recorder. (probably a stupid question but I don't quite understand how the GOM stuff works...I'm just glad it does!)

Ron

Reply With Quote
  #37 (permalink)
 Michael.H 
CA
 
Experience: Master
Platform: Marketdelta and Ninja
Broker: Velocity
Trading: NQ
Posts: 663 since Apr 2010
Thanks Given: 64
Thanks Received: 529

I actually went to edit ninjascripts, and did a compile manually. I then did f5 on all my charts, still won't say millisecond recorder. its says using binary on the side. Here's a pic


Gomi.. sorry.. stupid mistake. I didn't choose milisecond on the bottom. Few question...
1. will it replace the old bid/ask data if i switch formats to millisecond? found out it creates a new file... so disregard.
2. Is there a file converter that allows you to convert old binary data to be ported to millisecond data so it can use it as a lookback?
3. Also, if I have q collector, will it read it as soon as q collector is finished downloading it( after hitting F5 of course)? I don't have q collector yet. Reason i ask is simply because technically, it takes a few seconds to download data, and with this feature, there's no longer a need to leave computer on running 24/5
4.If we use q collector to backfill, can it ammend to millisecond data or is it a totally different file format (meaning you download for missing data, then as new data comes in using the recorder, that picks off where the qcollector left of)?

Is there a file format that you actually prefer or think works best?




this is truely amazing, you managed to overcome ninja's greatest problem, by yourself.....
I was talking to tim about this.... amazing how one person can do so much, but a team of coders at ninja couldn't fix this....

Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	356
Size:	19.5 KB
ID:	15284  
Reply With Quote
  #38 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505


rsi77 View Post
Hi Gomi,
Will new indicators need to be written or updated for this recorder, or will the current GOM package benefit from this recorder. (probably a stupid question but I don't quite understand how the GOM stuff works...I'm just glad it does!)

Ron

No nothing needs to be rewritten. All current indicators can benefit from this one.

Started this thread Reply With Quote
  #39 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505


Michael.H View Post
1. will it replace the old bid/ask data if i switch formats to millisecond? found out it creates a new file... so disregard.
2. Is there a file converter that allows you to convert old binary data to be ported to millisecond data so it can use it as a lookback?
3. Also, if I have q collector, will it read it as soon as q collector is finished downloading it( after hitting F5 of course)? I don't have q collector yet. Reason i ask is simply because technically, it takes a few seconds to download data, and with this feature, there's no longer a need to leave computer on running 24/5
4.If we use q collector to backfill, can it ammend to millisecond data or is it a totally different file format (meaning you download for missing data, then as new data comes in using the recorder, that picks off where the qcollector left of)?

Is there a file format that you actually prefer or think works best?

2. no. Millisecond data has to be written real time. It may actually work though if you use an input file (IRT, QCollector etc ) and your input file has milliseconds timestamps.
3. YOu will have a problem because the indicators keep a lock on the file so it won't be updateable by QCollector
I wanted to update the indicator with all the nice job of gooni ( ) but actually forgot;-)
Anyway, for now, you can't update your file using QCollector while it's used by any Gom indicator
4. I don't think QCollector does millisec.
5. File format preference : this millisec stuff is for guys that want to play around with millisec data. It may not be usable at all(check your network jitter with then monitoring app). If you don't need it you can stick to binary

Careful anyway using directyl QCollector files : in my case with esignal, 1 week is 500Mo, so parsing of the file is very long. Binary uses a few Mo for the same week, so you can read contract-long data with not too much pain.

Started this thread Reply With Quote
  #40 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505


Here's a new Converter that handles Millisec format.

You also have a command line mode using
GomFileConverter.exe inputfile inputformat outputformat ticksize

I also included the VS2010 project

Attached Files
Elite Membership required to download: GomFileConverterProject.zip
Elite Membership required to download: GomFileConverter.zip
Started this thread Reply With Quote




Last Updated on March 6, 2011


© 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