Friday, May 15, 2020

Code to download intra-day price quotes using Interactive Brokers API into csv files

Some time ago, I was searching the internet for data download of intra-day price quotes of futures contracts and forex.

The best I found was from Interactive Brokers(IBKR) which provided an API for programmers to download the quotes. This is applicable only for IBKR customers who need to write their own code to download the quotes. Not all data is free. Futures, stocks data require paid market data subscription. Forex and index CFDs are free.

I have written python code to download intra-day hourly price quotes of continuous futures contracts, CFDs and forex from Interactive Brokers API as csv files which are convenient for analytics purposes. The csv files can then be uploaded onto charting software like Amibroker which I use personally.

The code has been uploaded onto github.
https://github.com/hyom448/ib_intraday_quotes_csv

It should be useful to Interactive Brokers customers who have a programming background. The code can serve as a base for further modifications. It will be difficult for those who have no programming experience.

If someone knows of better alternatives to this data source, please drop a comment on this blog post or drop a message to me at Telegram user hyom448. Thank you.

PS: Regarding leveraged financial instruments such as futures, CFDs, forex, please avoid if you are inexperienced and do have not much interest in financial markets. Better stick to plain vanilla stocks/bonds or better still, stock/bond index ETFs which are non-leveraged, diversified by nature. 

I personally will steer clear of leveraged instruments unless I am confident of having an edge protected by risk management rules.

Picking the right Valentine. A much more difficult task than picking the right stocks

9 years ago, I wrote about choosing your Valentine from a value investing standpoint. What I wrote then still stands today, Beauty is over...