Kotlin API for Interactive Broker.

Hi folks, would like to share Kotlin/Java/REST API for Interactive Broker.

It uses the official IB TWS Java Driver internally, but hides all its complexities and exposes simple API as Kotlin API and HTTP REST service.

Kotlin API ib.kt

Video oveview for the REST API https://www.youtube.com/watch?v=wSFj3jZQ-oE

Example, geting stock price and stock option chain contracts

fun get_stock_price( symbol: String, // MSFT exchange: String, // SMART currency: String, // USD data_type: MarketDataType? // optional, realtime by default ): StockPrice fun get_stock_option_chain_contracts( symbol: String, // MSFT option_exchange: String, // AMEX, different from the stock exchange currency: String // USD ): OptionContracts ...

Currently it can get data about stocks, stock options, portfolio, etc., more stuff going to be added over time.

Repository https://github.com/al6x/ib_api


Installation is a bit tedious… as you need to manually download the official IB driver and do some copy / paste manually, no package available…

Also the Kotlin code style is…. a bit unusual. 🙂

submitted by /u/h234sd
[link] [comments]