Problem with OnMarketData() - NinjaTrader Programming | futures io social day trading
futures io futures trading


Problem with OnMarketData()
Updated: Views / Replies:3,805 / 35
Created: by ketron82 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

Problem with OnMarketData()

  #31 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,356 given, 83,237 received


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

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #32 (permalink)
Elite Member
Manchester, NH
 
Futures Experience: Beginner
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: Stocks
 
Posts: 902 since Jul 2012
Thanks: 603 given, 1,785 received


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
The following user says Thank You to artemiso for this post:
 
  #33 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,356 given, 83,237 received



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

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #34 (permalink)
Elite Member
Manchester, NH
 
Futures Experience: Beginner
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: Stocks
 
Posts: 902 since Jul 2012
Thanks: 603 given, 1,785 received


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
The following user says Thank You to artemiso for this post:
 
  #35 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,340 since Dec 2012
Thanks: 11,283 given, 7,092 received


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: https://futures.io/platforms-indicators/26161-tick-tick-market-replay-2.html#post485469


Cheers

Travel Well

Last edited by ratfink; March 26th, 2015 at 02:25 PM. Reason: linkage
Reply With Quote
The following 2 users say Thank You to ratfink for this post:
 
  #36 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,340 since Dec 2012
Thanks: 11,283 given, 7,092 received

update

Update here: https://futures.io/platforms-indicators/26161-tick-tick-market-replay-2.html#post485879

Travel Well
Reply With Quote

Reply



futures io > > > > > Problem with OnMarketData()

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
CalculateOnBarClose = false versus OnMarketData() MWinfrey NinjaTrader Programming 8 September 30th, 2013 01:52 PM
OnMarketData Problem humy65 NinjaTrader Programming 3 October 16th, 2012 11:17 AM
OnMarketData serious issue baberg NinjaTrader Programming 13 September 27th, 2011 10:04 AM
BUG for OnMarketData timmyb NinjaTrader Programming 12 February 5th, 2011 10:32 PM
Programming Indicators Using OnMarketData in NT7!!! RJay NinjaTrader Programming 3 December 16th, 2010 01:16 PM


All times are GMT -4. The time now is 03:19 AM.

Copyright © 2017 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
Page generated 2017-12-18 in 0.11 seconds with 19 queries on phoenix via your IP 54.163.209.109