NexusFi: Find Your Edge


Home Menu

 





Problem with OnMarketData()


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one ratfink with 11 posts (7 thanks)
    2. looks_two ketron82 with 9 posts (2 thanks)
    3. looks_3 artemiso with 5 posts (8 thanks)
    4. looks_4 Big Mike with 4 posts (3 thanks)
      Best Posters
    1. looks_one artemiso with 1.6 thanks per post
    2. looks_two Big Mike with 0.8 thanks per post
    3. looks_3 NJAMC with 0.7 thanks per post
    4. looks_4 ratfink with 0.6 thanks per post
    1. trending_up 9,816 views
    2. thumb_up 24 thanks given
    3. group 4 followers
    1. forum 35 posts
    2. attach_file 0 attachments




 
Search this Thread

Problem with OnMarketData()

  #31 (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,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608


artemiso View Post
Also, just to clarify, there's very little that your program can do to optimize this further and threading shouldn't be an issue. Most of your delay is going to come from your TCP client implementation and your message parsing.

The issue as I understand it, is NT was getting bogged down/slow. This is an NT problem or code running under NT, not an IQFeed problem.

When I was receiving 200 L2 streams, I was using 24 cores to do so with multiple threads to IQFeed servers. Mind you, a lot of the activity on my server was the fact it was recording the data. Still, it wouldn't be possible to efficiently receive that many symbols without using multiple threads with IQFeed.

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

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
NexusFi Journal Challenge - May 2024
Feedback and Announcements
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
34 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #32 (permalink)
 artemiso 
New York, NY
 
Experience: Beginner
Platform: Vanguard 401k
Broker: Yahoo Finance
Trading: Mutual funds
Posts: 1,152 since Jul 2012
Thanks Given: 784
Thanks Received: 2,685


Big Mike View Post
The issue as I understand it, is NT was getting bogged down/slow. This is an NT problem or code running under NT, not an IQFeed problem.

When I was receiving 200 L2 streams, I was using 24 cores to do so with multiple threads to IQFeed servers. Mind you, a lot of the activity on my server was the fact it was recording the data. Still, it wouldn't be possible to efficiently receive that many symbols without using multiple threads with IQFeed.

Mike

That shouldn't be the case, it's just barely several Mbps of data and it's just a TCP client handle read + tokenizer + cast in your processing step, a single-threaded implementation should be more than sufficient. I've done 500 concurrently on a single Nehalem core.

Reply With Quote
Thanked by:
  #33 (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,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608



artemiso View Post
That shouldn't be the case, it's just barely several Mbps of data and it's just a TCP client handle read + tokenizer + cast in your processing step, a single-threaded implementation should be more than sufficient. I've done 500 concurrently on a single Nehalem core.

Are you talking about one "connection" thread to IQFeed servers? Because that seems insane, if yes. I was talking about using multiple connections.

We are getting off-topic as well I think.

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
  #34 (permalink)
 artemiso 
New York, NY
 
Experience: Beginner
Platform: Vanguard 401k
Broker: Yahoo Finance
Trading: Mutual funds
Posts: 1,152 since Jul 2012
Thanks Given: 784
Thanks Received: 2,685


Big Mike View Post
Are you talking about one "connection" thread to IQFeed servers? Because that seems insane, if yes. I was talking about using multiple connections.

We are getting off-topic as well I think.

Mike

Yes, a single connection. We could discuss this on another thread some other time I guess, you can probably free up your cores.

Reply With Quote
Thanked by:
  #35 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


rleplae View Post
Because i am currently on replay data, that will be correct....
Thanks,
Ron

Don't believe it, I just satisfied myself that the Market Replay environment is not at all reliable as regards timestamps once you go multi-instrument. It holds up ok so long as all the series are for the same instrument, (apart from the OMD bip duplication issue that @NJAMC pointed out) but it falls apart as soon as any other instrument is added. I have checked this with Ninja's own data downloaded for the US market and with my own eSignal self-recorded data from Eurex and the Deutsche Bourse.

e.g. this is the sort of simple output that shows event order and timestamp order mismatches clearly:

bip 0 17:15:04 2105.25
bip 0 17:15:04 2105.25
bip 1 17:15:04 2105.25
bip 0 17:15:04 2105.25
bip 0 17:15:04 2105.25
bip 0 17:15:04 2105.25
bip 2 17:15:04 2105.25
bip 0 17:15:04 2105.25
bip 0 17:15:04 2105.25
bip 1 17:15:04 2105.25
bip 3 17:15:02 18102.3 last 23/02/2015 17:15:04 this 23/02/2015 17:15:02 2 max 11 tot 11969
bip 4 17:15:01 2107.78 last 23/02/2015 17:15:02 this 23/02/2015 17:15:01 1 max 11 tot 11970
bip 0 17:15:04 2105.25
bip 0 17:15:05 2105.25
bip 0 17:15:05 2105.25
bip 0 17:15:05 2105.25
bip 0 17:15:05 2105.25
bip 1 17:15:05 2105.25
bip 0 17:15:05 2105.25
bip 3 17:15:03 18102.4 last 23/02/2015 17:15:05 this 23/02/2015 17:15:03 2 max 11 tot 11972
bip 0 17:15:05 2105.25
bip 3 17:15:04 18102.5 last 23/02/2015 17:15:05 this 23/02/2015 17:15:04 1 max 11 tot 11973
bip 3 17:15:05 18102.4
bip 3 17:15:06 18102.4
bip 3 17:15:07 18102.4
bip 3 17:15:08 18102.4
bip 3 17:15:09 18102.2
bip 3 17:15:10 18102.2
bip 3 17:15:11 18102.2
bip 3 17:15:12 18102.2
bip 3 17:15:13 18102.2
bip 3 17:15:14 18102.2
bip 3 17:15:15 18102.2
bip 4 17:15:15 2107.75
bip 3 17:15:16 18102.2
bip 3 17:15:17 18102.1
bip 3 17:15:18 18102.1
bip 3 17:15:19 18102.1
bip 3 17:15:20 18102.1
bip 3 17:15:21 18102
bip 3 17:15:22 18102
bip 3 17:15:23 18102
bip 3 17:15:24 18101.9
bip 3 17:15:25 18101.8
bip 0 17:15:06 2105 last 23/02/2015 17:15:25 this 23/02/2015 17:15:06 19 max 19 tot 11992
bip 0 17:15:28 2105
bip 0 17:15:28 2105
bip 1 17:15:28 2105
bip 0 17:15:28 2105
bip 0 17:15:28 2105
bip 0 17:15:28 2105
bip 0 17:15:28 2105
bip 0 17:15:28 2105

In this case bip 0-2 are ES, bip 3 is DJIA and bip 4 is SPX, all simple TICK series, not even the time based series issue to mess it up and all Historical data issues eliminated. Showing a maximum 19 sec hiccup in this recorded US intraday session. Obviously we don't worry about single second reports as that is NT's limited replay resolution but make no assumptions appears to be in order.

Just to note that the same data shows no problems whatsoever so long as the test is kept intra-series, within any of the series. Points pretty heavily at MR imho. I am revising my future test plans and architecture as a result.

edit: Reposted in more relevant thread with further detail:


Cheers

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #36 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425

Update here:

Travel Well
Visit my NexusFi Trade Journal Reply With Quote




Last Updated on March 28, 2015


© 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