Live data from Hacker News

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

github.com

21–30 of 36 posts

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

#21
Wow, didn't expect my repo to make it this far. It was my first time using Reddit, with the aim of introducing this for research more than actual trading.

Just some thoughts after reading comments:

- I've got a number of Python examples for trading futures, but a third-party app is required as 'the gateway'. Browse on GitHub if you wish: https://github.com/hftstrat/The-Gateway-code-samples

- Backtesting is a topic not to be taken lightly. There are far too many issues to address than just historical simulation. I've written a book covering this topic.

- In my book I've also covered the use of Oanda API with a simple trend-following strategy. Available on Amazon: http://www.amazon.com/Mastering-Python-Finance-James-Weiming...

- Table of contents and source codes used in my book are also available on GitHub: https://github.com/jamesmawm/Mastering-Python-for-Finance-so...

Alright, I'm done with shameless promotion of my links ;p

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

#22

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.

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

#23

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.

Put in 15; enter some low maintenance positions. Simple ideas: sell some spreads on SPY, hold low vol.

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

#24

Great stuff. I think the author would have been better suited without mentioning HFT, maybe algo trading model?, as its a lighting rod for controversy. If anything I thin this is useful to illustrate just how hard it is to write a full blown trading system. So maybe we could look at what you could add to this to make it something you could use in production(Note, please don't use this in production). 1) Risk system,…

Any good resources regarding building risk systems for someone who is new to the field?

Here are some ideas:

- throttle your orders to the market

- set a threshold for market risk you can take per symbol, per sector, etc.

- take into consideration average daily volume of a symbol for calculating market risk threshold

- implement controls to send cancels for unfilled orders in the event if algo goes haywire

- reject orders priced at some percentage less or more than current market price per share

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

#25
I have read the anti-FlashBoys book to try and grasp it (HFT is not bad and has cut spreads in equities by 5/6ths in ten years) but I still do not understand one HFT algorithm (other than the debunked front running idea)

Could someone explain what algo traders / HFT actually do? Is it all looking for a variation off of a relationship between say OrangeGrowersInc and OrangeJuiceBottlers Inc? And why is speed so important then?

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

#27

It's strange to call this HFT. The author makes a note of it, and I suppose has the right to call it whatever he wants. However, newbies who use this project to learn automated trading should be aware that this is not considered HFT in the industry.

I would love to hear your definition of HFT. I've worked in the industry and never seen it defined well.

Agree with you that there is no definition of HFT. If you define it by your trading forecast horizon then I've seen some people argue that HFT could be as long as a few hours. Could you argue that HFT on a multiple second or shorter forecast timescale is not HFT? I think HFT is, more broadly, any sort of intraday trading where your signals are derived from intraday tickdata.

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

#28

I have read the anti-FlashBoys book to try and grasp it (HFT is not bad and has cut spreads in equities by 5/6ths in ten years) but I still do not understand one HFT algorithm (other than the debunked front running idea) Could someone explain what algo traders / HFT actually do ? Is it all looking for a variation off of a relationship between say OrangeGrowersInc and OrangeJuiceBottlers Inc? And why is speed so impor…

What is the "anti-FlashBoys" book?

(Asuming you don't mean FlashBoys)

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

#29
post #28

I have read the anti-FlashBoys book to try and grasp it (HFT is not bad and has cut spreads in equities by 5/6ths in ten years) but I still do not understand one HFT algorithm (other than the debunked front running idea) Could someone explain what algo traders / HFT actually do ? Is it all looking for a variation off of a relationship between say OrangeGrowersInc and OrangeJuiceBottlers Inc? And why is speed so impor…

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...

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

#30
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 are automated systems really only employed in HFT?

Post reply on HN