- IB-Matlab’s main product page
- Quick-reference help
- Full User Guide (PDF)
- Usage syntax details – see below
- Usage examples
- Questions & Answers
- Real-time trading system demo that uses IB-Matlab, presented at the MATLAB Computational Finance Conference in New York in May 2013, and at the MATLAB Computational Finance Virtual Conference in Sep 2013 (presentation slides, demo source-code, webinar video).
- Two reviews of IB-Matlab were published in the Automated Trader magazine (2011, 2012). The full reviews (PDF) are available for download here (2011, 2012) – see excerpts below.
- User testimonials – see below
- IB’s online API Guide
Usage syntaxMultiple usage examples are provided here; many more examples and detailed information are available in the IB-Matlab User Guide.
[orderId,ibConnectionObject,contract,order] = IBMatlab(varargin)
Possible inputs parameters:
- varargin = Matlab struct or fieldname/value pairs with the following optional fields:
- Connection: ClientId, Host, Port, AccountName
- Contract data: Symbol, LocalSymbol, SecType, Exchange, Currency, Multiplier, Expiry, Strike, Right
- Action: one of Buy, Sell, SShort, Close, Exercise, Lapse, Query, Cancel, Account, Portfolio, History, Realtime, Scanner, Contract, Fundamental, License, or Version
- Query type: either OPEN [for the list of open orders], or EXECUTIONS [for the list of today’s executions]
- Order type: one of MKT, MKTCLS, LMT, LMTCLS, PEGMKT, STP, STPLMT, MIT, TRAIL, REL, TWAP, VWAP, GuarranteedVWAP, TRAILLIMIT, etc. – see full list here and detailed explanations here; note that IB prevents some combinations of orders and securities
- Order data: Action, Quantity, TIF, LimitPrice, AuxPrice, OCAGroup, ParentId, TrailingPercent, TrailStopPrice, GoodAfterTime, GoodTillDate, BracketDelta, BracketTypes, TriggerMethod, OutsideRTH, OrderId, Hold, Timeout, HedgeType, HedgeParam
- TWAP/VWAP order data: StrategyType, MaxPctVol, StartTime, EndTime, AllowPastEndTime, NoTakeLiq
- Combo order data: ComboActions, ComboRatios, ComboBagSymbol
- Automated order data: LimitBasis, LimitDelta, LimitRepeatEvery, LimitUpdateMode, LimitChangeTime, LimitChangeType, Tick
- Historic/intra-day data: EndDateTime, DurationValue, DurationUnits, BarSize, WhatToShow, UseRTH, FormatDate, IncludeExpired (note IB’s pace limitations)
- Streaming quotes data: QuotesNumber, QuotesBufferSize, ReconnectEvery, GenericTickList
- Market depth (order book) data: NumberOfRows, QuotesNumber
- Scanner parameters: Type, ParametersType, AbovePrice, AboveVolume, AverageOptionVolumeAbove, BelowPrice, CouponRateAbove, CouponRateBelow, ExcludeConvertible, Instrument, LocationCode, MarketCapAbove, MarketCapBelow, MaturityDateAbove, MaturityDateBelow, MoodyRatingAbove, MoodyRatingBelow, NumberOfRows, ScanCode, ScannerSettingPairs, SPRatingAbove, SPRatingBelow, StockTypeFilter
- Financial advisors: FAProfile, FAGroup, FAMethod, FAPercentage
- Event callbacks: CallbackFunction, CallbackAccountDownloadEnd, CallbackAccountSummary, CallbackAccountSummaryEnd, CallbackBondContractDetails, CallbackCommissionReport, CallbackConnectionClosed, CallbackContractDetails, CallbackContractDetailsEnd, CallbackCurrentTime, CallbackDeltaNeutralValidation, CallbackExecDetails, CallbackExecDetailsEnd, CallbackFundamentalData, CallbackHistoricalData, CallbackManagedAccounts, CallbackMarketDataType, CallbackMessage, CallbackNextValidId, CallbackOpenOrder, CallbackOpenOrderEnd, CallbackOrderStatus, CallbackPosition, CallbackPositionEnd, CallbackTickPrice, CallbackTickSize, CallbackTickString, CallbackTickGeneric, CallbackTickEFP, CallbackTickOptionComputation, CallbackTickSnapshotEnd, CallbackRealtimeBar, CallbackReceiveFA, CallbackScannerData, CallbackScannerDataEnd, CallbackScannerParameters, CallbackUpdateAccountTime, CallbackUpdateAccountValue, CallbackUpdateMktDepth, CallbackUpdateMktDepthL2, CallbackUpdateNewsBulletin, CallbackUpdatePortfolio
- General: LogFileName, MsgDisplayLevel
- orderId = -1 if unsuccessful, otherwise the ID of the placed order, or data for ‘QUERY’ actions
- ibConnectionObject = reference of Java object that interfaces with IB
- contract = object that holds contract info for Buy/Sell actions when Hold=1 (see example 10 below)
- order = object that holds order info for Buy/Sell actions when Hold=1 (see example 10 below)
Representative usage examples of IB-Matlab are available here. The following examples are available:
- Buy a security
- Sell a security
- Get portfolio data
- Get account data
- Get market data (snapshot) for a security
- Get historic/intra-day data
- Get streaming quotes data
- Get realtime bars data
- Get detailed contract information
- Get options-chain information
- Get scanner filter data
- Access, modify and cancel open orders
- Get executions data
- Specify event callback – ExecDetails
- Specify event callback – TickGeneric
- Use the underlying Java connector to cancel or customize an order
So, do we like it? Well, IB-MATLAB is robust, very easy to learn how to use and does exactly what it claims to do – namely provide a simple and efficient order interface between MATLAB and Interactive Brokers’ API. It also costs peanuts…
So yes, we like it – a lot.
All told, we regarded the enhancements to IB-MATLAB since we last reviewed it as significant. The order submission process was rock solid as before, but the new capabilities really open up the possibilities – especially for trading that is analytically intensive but not high frequency. We were able to deploy multiple models in real time to IB’s trading platform without any difficulties or glitches. …
IB-MATLAB effectively contradicts the declaration we’ve seen on more than a few web sites that “MATLAB is not for real time trading”.
Easy integration with IB through IB-Matlab… The * Toolbox isn’t very robust, it’s really buggy, … I would love to get the * Toolbox up and running, but I think that Yair has got it covered for Interactive Brokers, I just use his program…
IB-Matlab is our wrapper for the IB API, so that we don’t have to write our own Java connector. IB-Matlab is a robust Java connector, complete wrapper for the IB API. A cheap investment, it’s definitely worth it. I can’t even stress enough how much time it will save you. Don’t build from scratch, it is cheaper and faster to buy from 3rd-party vendors. If I was to build IB-Matlab it would take me several weeks and for only $400 I could have a turnkey solution, I mean it’s a no-brainer there… It’s better than those retail trading platforms. This is the cheapest professional-grade system that you can get. IB connected to IB-Matlab connected to Matlab connected to the Data-Feed Toolbox connected to IQFeed is the cheapest technology stack that will give you trading robustness.
Yair is extremely helpful, provides great customer support.
– Chris Reeves, A2X Capital, Feb 27, 2015 (“Algorithmic Trading System” video)
Also quoted: IB-Matlab is the most robust wrapper for the IB API I have come across. Amazing value for the price!
– creeves, Feb 23, 2015 (comment posted about IB-Matlab on IB’s Marketplace)
…At that point I turned to Yair Altman’s IB-Matlab product. Happily, this uses IB’s Java api, which is a great deal more robust than the ActiveX platform. It’s been some time since I last used IB-Matlab and was pleased to see that Yair has been very busy over the intervening period, building the capabilities of the system and providing very comprehensive documentation for it. With Yair’s help, it took me no time at all to get up and running and within a day or two the system was executing orders flawlessly in IB’s TWS. …
Yair is very generous with his time in providing support to his users and his responses to my questions were fast and detailed.
– Jonathan Kinlay, Quantitative Research and Trading, March 5, 2015 (“Algorithmic trading” article)
The following testimonials appear on IB’s Marketplace, where IB-Matlab is the top-rated product, with a perfect score of 5.000 stars from dozens of traders:
All these quotes are from real IB traders, who took the time to comment about IB-Matlab on IB’s website. Numerous other traders have provided similar statements by email.
In addition to the quoted testimonials above, all of whom rated IB-Matlab with a perfect 5-star rating, about a dozen other traders have also voted IB-Matlab with 5 stars, without attaching a comment. Not even a single trader has voted Matlab with a lower vote. This perfect score of 5.000 stars from dozens of traders is unparalleled by any other program on the IB Marketplace. We take great pride in providing a great product, fantastic value, and excellent customer service.
Free trial version
A fully-functional free trial version is available – just request your trial and you will get a no-obligations copy with detailed installation and usage instructions.
There are absolutely no strings attached: the trial is completely free and fully functional, just limited in duration.
You only need the basic Matlab, no toolbox is required. You can be up and running within minutes. We are confident that you will love the product, so we encourage you to test it:
You will receive the trial installation instructions to your specified email within 24 hours. If you do not get an email within 24 hours, then please check your email’s spam folder, or send a direct email to altmany at gmail.com