• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

softwarespartan/IB4m: Interactive Brokers API for Matlab

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

softwarespartan/IB4m

开源软件地址(OpenSource Url):

https://github.com/softwarespartan/IB4m

开源编程语言(OpenSource Language):

MATLAB 89.4%

开源软件介绍(OpenSource Introduction):

<style type="text/css"> </style>

Welcome to IB4m

Interactive Brokers API for Matlab

Contents

Quick Start Guide

Getting started with IB4m is easy. The updated Interactive Brokers API docs for v9.73+ are here: https://interactivebrokers.github.io/tws-api/. Use the code examples in the

IB4m/docs
folder which have been updated for v9.73 API. Follow the steps below assuming you already have an IB tradding account and Trader Workstation installed.

  1. Enable API access in TWS for "Active X and Socket Clients"**
  2. Add trusted IP address for local host 127.0.0.1 in TWS**
  3. Clone IB4m on Github: git clone https://github.com/softwarespartan/IB4m.git

**(File -> GlobalConfiguration -> API -> Settings)

Navigate to the IB4m directory in Matlab

cd ~/Dropbox/IB4m

OK, now add IB4m and IB4m/docs to your matlab path

addpath(path,pwd);  addpath(path,fullfile(pwd,'docs'))

Finally, add TWS973.jar to the (dynamic) java classpath

javaaddpath(fullfile(pwd,'Jar','TWS973.jar'))

You're all set! Do a quick test to get summary of your IB account

AccountSummaryExample
added interface method: TWSNotification
notification listener has been added
Server Version:75
TWS Time at connection:20150104 18:32:00 EST
DU207406: RegTEquity = 1003650.61 (USD)
DU207406: LookAheadInitMarginReq = 0.00 (USD)
DU207406: RegTMargin = 0.00 (USD)
DU207406: GrossPositionValue = 0.00 (USD)
DU207406: LookAheadNextChange = 0 ()
DU207406: SMA = 1003650.62 (USD)
DU207406: ExcessLiquidity = 1003650.61 (USD)
DU207406: FullMaintMarginReq = 0.00 (USD)
DU207406: InitMarginReq = 0.00 (USD)
DU207406: FullAvailableFunds = 1003650.61 (USD)
DU207406: MaintMarginReq = 0.00 (USD)
DU207406: LookAheadMaintMarginReq = 0.00 (USD)
DU207406: FullExcessLiquidity = 1003650.61 (USD)
DU207406: LookAheadAvailableFunds = 1003650.61 (USD)
DU207406: LookAheadExcessLiquidity = 1003650.61 (USD)
DU207406: DayTradesRemaining = -1 ()
DU207406: FullInitMarginReq = 0.00 (USD)
DU207406: Cushion = 1 ()
DU207406: AvailableFunds = 1003650.61 (USD)

To save your matlab path use "savepath" or "pathtool". Also, consider adding TWS.jar to your static java classpath ("edit classpath.txt"). Otherwise, will need to add the jar file after each matlab restart.

Tutorials

Tutorials for MarketData, Scanner Subscriptions, Execution Details, and more. Everything you need to get up and running. NOTE: The example codes in the IB4m/docs folder for each of the tutorials below has been updated for API v9.73+ but the html in IB4m/docs/html is still older v9.72 API. Will update html soon.

Getting More Help

Feel free to open an issue or email brown.2179-at-gmail.com with questions, suggestions, comments etc.

References

System Requirements

IB4m has been tested on OSX 10.10, Windows 7, and Windows 8 with both Java 7 and Java 8 using the latest versions of Trader Workstation (Dec 19, 2014, Server versions 75 and 76)

Note that older versions of Matlab might use Java 6. You can use the links below to launch Matlab with different (newer) version of Java

Finally, make sure to double check your IB account data subscriptions if you have trouble with obtaining historical data etc.


Published with MATLAB® R2014b




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap