¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Anybody uses TWS API and Nanex datafeed?


 

My app uses TWS API and Nanex for rapid trading. I use and maintain it for years but there are still tiny issues and improvements that require constant attention.
Anybody knows/has a platform with that combination of brokerage and data feed? Any open source project?
If not, I'm going to create one but need collaborators.

One advantage I have (in my view) is that each symbol (stock) lives in an individual thread.
Each thread has data inbox and processing goes without any locks with maximum speed.
A millisecond to make a decision is the max, usually less.
Not sure if that's the best solution but I didn't find any better in years.
Any advices?


 

It's fully automated high-fequency trading platform. Just plug your own algorithm and go back to sleep.


 

When you say TWS API + Nanex is a "high frequency trading platform", what quoting latency (in microseconds) are you seeing between your servers and the CTS?? How have you measured this and proven it to be accurate?

?


 

I didn't measure it yet with high precision timer. My point is only this: the system is written in highly efficient way in C++, optimized for speed.
There is no delays between quote arrival / decision making / order submission.
Only assembler and some hardware/network tweaks can make it faster.
To me its a high frequency but I don't know what industry standards are. Do you know any specific target numbers?


Nick
 

¿ªÔÆÌåÓý

There is no single universal definition of HFT.

But since your post stresses speed I think Blaze is asking how you think you can compete with institutions that have hardware located at the exchange.

It takes longer to transmit an order from a TWS api app to TWS/Gateway than it does for computers at the exchange to do their processing.


On 10/19/2020 10:02 AM, Alex wrote:

I didn't measure it yet with high precision timer. My point is only this: the system is written in highly efficient way in C++, optimized for speed.
There is no delays between quote arrival / decision making / order submission.
Only assembler and some hardware/network tweaks can make it faster.
To me its a high frequency but I don't know what industry standards are. Do you know any specific target numbers?


 

I can't compete with those institutions yet.
And my algos do not require such speeds.
I'm just reducing speed as much as I can.
Optimized C++ code and colocation is enough.
Nanex servers are in Equinix NY2 Secaucus Data Center.
IB servers are in? Equinix NY5 Secaucus Data Center.
Colocate in one of those, cross-wire and you have pretty good speeds.

There are also counterintuitive examples where increasing time of order delivery can increase your profits.
One of those in Flash Boys.

?


 

It meant to be "reducing time" not "reducing speed"?


 

I don't think there are any standards around this except the fastest usually wins.

You really haven't measured your quoting latency?? Hmm!


 

On Mon, Oct 19, 2020 at 07:53 AM, Alex wrote:
Nanex servers are in Equinix NY2 Secaucus Data Center.
IB servers are in? Equinix NY5 Secaucus Data Center.
Colocate in one of those, cross-wire and you have pretty good speeds.

Cool.? Have you done a cross connect with Nanex or IB?


 

The measurement must be done but its not urgent because I already used all possible ways to speed up that I know of.
Knowing what's the actual number is will not change anything.
I didn't colocate yet, so no cross connect.

So those who are interested in this fast and free platform it is coming here:


Nanex is not a requirement, you can use quotes from IB.


 

What you mean a "fast and free plateform" ?

I just found a template, nothing exist aside of class def and template.

Did I miss something ?


 

Speed checking is pretty simple, can you catch any of theses Nanex lot s, and see that yourself did got it ?

(Nanex allow you to catch how execution proceed on lot s, on some exchanges, not every)
Nanex allow to know pending (non executed) bid or ask AND the exchange that hold it, more reliably that polygon
(that proudly said to deliver pico-second date of transact, but ommit to say that it require miilsec and expensive JSON format to get it (in short: your right! C ++ and binary are far more efficient, and an ancient art!)


Some time speed is not the issue because the order will stay long enough (couple of miilisec)
Some other time all happens in darkpool and your priority depends on how much cash you brought in ;-)
Some time luck is enough to compensate and your decision was just premature.

General rule,
- millisec range:? what are you doing here ? IB can't AT ALL be a solution for you

- second range: IB is OK but barely, the good thing is to compensate for lack of efficiency or their plateforme and bypass their ' algos' ;-)

IB is a JavaShop and Java is? pretty inefficient for perfs theses days.
BUT
IB is a good choice because of decent execution compared to their low brokerage fees,

Individual prefer platform like Ameritrade, safer and simple to use.

However if you intend to really do HFT , Expecting that server proximity is enough is not a safe enogh assumption.
Nothing prevent that IB server may have to connect to another one far away to grant your transaction in your account.
You need "Direct market access" , generally by finding an exchange that cheap enough to start with (couple of Grant/month anyway) BATS or alike.
Then gradually connect direct to Nasdaq then Nyse (or CBOE if you like Futures)

But "yes you can" do enough cash improving the ugly buggy and inefficient TWS. Bypassing Ibalgo and all this crop.
I wonder what you expect out of Nynex aside of a global understanding of sector rotation.

I also wonder how much you pay for Nanex ?
A decent span listneng to Nasdaq(with LII) + Nyse cost at least 1 Grant/month, does your algo pay back this extra charge cpmpared with TWS listening ?

?


 

It will be there soon. I'm refactoring my app and creating one as open source project.


 

IB is good enough considering the resources and time I have.
Connecting to exchanges is a lot of work. Maybe later.
I can't say details of my contract with Nanex but some people on the internet are talking about $1K/month for all US stocks.
That's for every tick real-time.
Similarly for options/commodities/forex.
Of course it pays off.


 

Nanex seems like a nice offering in terms of a simple append-only log you can easily replay,?and C-struct based API. I like the sound of that, and could even get over the windows binary ¡ª can I connect to that over tcp?

Checking out the website though, goodness. Non-ssl, not updated in ~10 years, I would read this as either they are super low-frills and growing organically with plenty of happy paying?customers, or they are kind of atrophied and could go close shop at any time.?

On Wed, Oct 21, 2020 at 2:04 PM Alex <btccplayer@...> wrote:
IB is good enough considering the resources and time I have.
Connecting to exchanges is a lot of work. Maybe later.
I can't say details of my contract with Nanex but some people on the internet are talking about $1K/month for all US stocks.
That's for every tick real-time.
Similarly for options/commodities/forex.
Of course it pays off.


 

Was it nanex.net you visited? Nice minimalist design.
Their product installs in seconds, you load local binary (dll) to start receiving tons of highly compressed data.
It's revolutionary. Nobody stands near by.
Next best would be direct connections to exchanges for 10x in price and 1000x in amount of work.


Jeff Han
 

Hi Alex,

I was using Nanex over a year ago, and considering to use it again

at that time, the exg_time timestamp from NxCoreHeader and nxc_time timestamp from NxCoreSystem were ranging from 20ms to over several seconds, so I gave up on them.

they were saying they would update the system and got the time (from exchange time to their processing time under a few milliseconds), what's the delay looking like nowadays?

Thanks
Jeff


Jeff Han
 

I still do not know yet, and hopefully I'm not wrong and years of work will not down the drains. the idea is to be fast enough to detect and follow the big fish, not compete with

my app is C++ app is fast enough, every cycle is in less 80 microseconds even with flexible and complex ta and algo configuration, but the big delay are the data feed, and order execution which you have to pay dearly to speed it up


 

¿ªÔÆÌåÓý

Hi there

I would like to suggest you read, unless you already have, two books. I am NOT trying to say you are wasting your time. Far from it. It's just the "nerds" book might help you learn from history and the "solved" book might help with seeing an approach that seems to have merit.? You might also want to consider looking at a language called Julia from MIT especially with the advent of cheap supercomputing from Nvidia.

Again just some friendly observations that might make your journey more fun.



On 11/29/20 7:07 AM, Jeff Han wrote:

I still do not know yet, and hopefully I'm not wrong and years of work will not down the drains. the idea is to be fast enough to detect and follow the big fish, not compete with

my app is C++ app is fast enough, every cycle is in less 80 microseconds even with flexible and complex ta and algo configuration, but the big delay are the data feed, and order execution which you have to pay dearly to speed it up


 

I didn't notice any delays. But I need to compare those two timestamps yet.