Documentation
- 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.
- Reviews and testimonials
- IB’s online API Guide
Usage syntax
Multiple usage examples are provided here; many more examples and detailed information are available in the IB-Matlab User Guide.The general syntax (quick help reference; detailed user guide) is:
[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, IncludeExpired
- 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, AccountName
- 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
Outputs:
- 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)
Usage examples
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
Many more examples and detailed information are available in the IB-Matlab User Guide. Contact us if you have any questions.
Reviews and testimonials
The following testimonials appear on IB’s Marketplace, where IB-Matlab is the top-rated product, with a perfect rating of 5.000 stars from over 100 independent traders:
These quotes are from real IB traders, who took the time to comment anonymously about IB-Matlab on IB’s website using IB’s system. Over 100 traders have anonymously rated IB-Matlab on IB’s website – all of them, without exception, rated IB-Matlab with a perfect 5-star rating. Such perfect rating and superlatives from so many independent traders is unparalleled by any other program on the IB Marketplace. Numerous other traders have provided similar statements about IB-Matlab by private email.
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