Live data from Hacker News

A high-frequency trading model using Interactive Brokers API in Python

github.com

31–36 of 36 posts

Re: A high-frequency trading model using Interactive Brokers API in Python

#31

Tangentially related question. As a relative newbie to (automated/ algo) trading systems, it seems most of posts here focus on systems that deal with large volumes of trades in very short timeframes. I'd be interested in writing an automated system that would focus on trading (investing) over longer timespans (shares, options), with (average) returns. Are there any resources you would recommend to get into this? Or a…

What is a "longer timespan"? Minutes instead of seconds? Days instead of minutes? Month instead of days?

Automated trading systems only really make sense when you are trading a pace that is too fast for humans to reliably execute. If you have time for human intervention it is much better to produce a system that simply spits out reports and recommendations that you can act on (or not), rather than having a system trade automatically. If nothing else it can save you from losing all your money due to an unfortunate off-by-one error or something.

Re: A high-frequency trading model using Interactive Brokers API in Python

#32

Pretty cool stuff. Thanks for posting holoiii. Last year, I took some time off to build an IB API client in Java/Scala for options trading. The biggest challenge I faced personally was dealing with concurrency of maintaining my positions, orders and quote ticks which led to orders as IB API is based on a asynchronous tick model. I ended up re-writing my code with lots of threads/locks to more code with immutability.…

Is it possible to get IB API access without opening a 10k account? Do they have a demo endpoint you can use? If you didn't already have an existing system built, having 10k tied up while you build one seems undesirable.

You would have to put in at least $25k to do anything serious, since the pattern day trading rule would definitely be triggered.

Re: A high-frequency trading model using Interactive Brokers API in Python

#33
post #31

Tangentially related question. As a relative newbie to (automated/ algo) trading systems, it seems most of posts here focus on systems that deal with large volumes of trades in very short timeframes. I'd be interested in writing an automated system that would focus on trading (investing) over longer timespans (shares, options), with (average) returns. Are there any resources you would recommend to get into this? Or a…

What is a "longer timespan"? Minutes instead of seconds? Days instead of minutes? Month instead of days? Automated trading systems only really make sense when you are trading a pace that is too fast for humans to reliably execute. If you have time for human intervention it is much better to produce a system that simply spits out reports and recommendations that you can act on (or not), rather than having a system tra…

In terms of timespan, I was thinking days/ months. So it would take the aspect of human intervention and analysis/ research out of it (perhaps the system could still prompt the user for input, the user would just not have to monitor markets and positions actively). I don't know if this makes sense.

Re: A high-frequency trading model using Interactive Brokers API in Python

#34
post #31

Earlier quoted context omitted.

What is a "longer timespan"? Minutes instead of seconds? Days instead of minutes? Month instead of days? Automated trading systems only really make sense when you are trading a pace that is too fast for humans to reliably execute. If you have time for human intervention it is much better to produce a system that simply spits out reports and recommendations that you can act on (or not), rather than having a system tra…

In terms of timespan, I was thinking days/ months. So it would take the aspect of human intervention and analysis/ research out of it (perhaps the system could still prompt the user for input, the user would just not have to monitor markets and positions actively). I don't know if this makes sense.

The problem with most HFT/algorithmic approaches is that it relies on large volumes to make profits. If you're averaging a very tiny profit pr. trade (with a large variance) you're going to have to make a lot of big trades and be able to sustain large temporary losses to make money.

That's not to say that computer assisted trading isn't a good idea for smaller time investors, but the focus is on assistance, not automation. You can write models that produce a shortlist of stocks and options that match certain criteria and you can write risk and portfolio models that try to model what might happen if you add or remove a certain asset from your portfolio, then you can combine these and run some sort of optimization algorithms over the whole thing. But at the end of day, the choice should be made by a smart informed human and should be heavily biased by your reading of the news and other external sources.

All that being said, if you decide to go into this, approach it first as a hobby rather than a job, with the assumption and acceptance that most hobbies cost, especially in the short run. If you just want to do something smart with your money, buy some index funds.

Re: A high-frequency trading model using Interactive Brokers API in Python

#35
post #28

Earlier quoted context omitted.

What is the "anti-FlashBoys" book? (Asuming you don't mean FlashBoys)

Flash Boys: Not So Fast http://www.amazon.co.uk/gp/aw/d/B00P0QI2M2?ie=UTF8&redirectF...

Yes thank you. Well worth reading. I was quite annoyed by what seems to be such evident lack of critical thinking by Michael Lewis

I picked up (and have even blogged about) the idea that "good" traders were trying to buy 100m USD of BP shares in three different exchanges and that by the time 1/3 of the order hit London HFT traders "somehow" worked out that there was another 2/3 going and sped over microwave towers to front run the order. But how do you work out that the london order is going to be for 100m? What if it's just for 50m - suddenly you have bought 50m shares of BP no one wants. It's an insane risk.

So I still don't know what HFT and algo is about (it seems to be there are arbitrage opportunities between strongly correlated stocks, and presumably arbitrage opportunities between strongly correlated stocks in different exchanges. And the speed issue is having to beat other people who have the same algo / correlation as you)

But honestly I would like some confirmation

Re: A high-frequency trading model using Interactive Brokers API in Python

#36
post #32

Earlier quoted context omitted.

Is it possible to get IB API access without opening a 10k account? Do they have a demo endpoint you can use? If you didn't already have an existing system built, having 10k tied up while you build one seems undesirable.

You would have to put in at least $25k to do anything serious, since the pattern day trading rule would definitely be triggered.

PDT rule only applies to stocks and options afaik, and only if you have a margin account. It doesn't affect futures/equities/forex.
Post reply on HN