Public Member Functions

View as MarkdownOpen in Claude
NameTypeDescription
error (Exception e)voidHandles errors generated within the API itself. If an exception is thrown within the API code it will be notified here. Possible cases include errors while reading the information from the socket or even mishandling at EWrapper’s implementing class. More…
error (string str)voidNone
error (int idvoidint errorCode
currentTime (long time)voidTWS’s current time. TWS is synchronized with the server (not local computer) using NTP and this function will receive the current time in TWS. More…
tickPrice (int tickerIdvoidint field
tickSize (int tickerIdvoidint field
tickString (int tickerIdvoidint field
tickGeneric (int tickerIdvoidint field
tickEFP (int tickerIdvoidint tickType
deltaNeutralValidation (int reqIdvoidDeltaNeutralContract deltaNeutralContract)
the server sends a deltaNeutralValidation() message with the DeltaNeutralContract structure. If the delta and price fields are empty in the original requestUpon accepting a Delta-Neutral DN RFQ(request for quote)the confirmation will contain the current values from the server. These values are locked when RFQ is processed and remain locked until the RFQ is cancelled.
NoneMore…None
tickOptionComputation (int tickerIdvoidint field
tickSnapshotEnd (int tickerId)voidWhen requesting market data snapshots
nextValidId (int orderId)voidReceives next valid order id. Will be invoked automatically upon successfull API client connection
managedAccounts (string accountsList)voidReceives a comma-separated string with the managed account ids. Occurs automatically on initial API client connection. More…
connectionClosed ()voidCallback to indicate the API connection has closed. Following a API TWS broken socket connection
accountSummary (int reqIdvoidstring account
accountSummaryEnd (int reqId)voidnotifies when all the accounts’ information has ben received. Requires TWS 967+ to receive accountSummaryEnd in linked account structures. More…
bondContractDetails (int reqIdvoidContractDetails contract)
updateAccountValue (string keyvoidstring value
updatePortfolio (Contract contractvoiddecimal position
updateAccountTime (string timestamp)voidReceives the last time on which the account was updated. More…
accountDownloadEnd (string account)voidNotifies when all the account’s information has finished. More…
orderStatus (int orderIdvoidstring status
openOrder (int orderIdvoidContract contract
openOrderEnd ()voidNotifies the end of the open orders’ reception. More…
contractDetails (int reqIdvoidContractDetails contractDetails)
contractDetailsEnd (int reqId)voidAfter all contracts matching the request were returned
execDetails (int reqIdvoidContract contract
execDetailsEnd (int reqId)voidindicates the end of the Execution reception. More…
commissionReport (CommissionReport commissionReport)voidprovides the CommissionReport of an Execution More…
fundamentalData (int reqIdvoidstring data)
historicalData (int reqIdvoidBar bar)
historicalDataUpdate (int reqIdvoidBar bar)
historicalDataEnd (int reqIdvoidstring start
marketDataType (int reqIdvoidint marketDataType)
updateMktDepth (int tickerIdvoidint position
updateMktDepthL2 (int tickerIdvoidint position
updateNewsBulletin (int msgIdvoidint msgType
position (string accountvoidContract contract
positionEnd ()voidIndicates all the positions have been transmitted. More…
realtimeBar (int reqIdvoidlong date
scannerParameters (string xml)voidprovides the xml-formatted parameters available from TWS market scanners (not all available in API). More…
scannerData (int reqIdvoidint rank
scannerDataEnd (int reqId)voidIndicates the scanner data reception has terminated. More…
receiveFA (int faDataTypevoidstring faXmlData)
verifyMessageAPI (string apiData)voidNot generally available.
verifyCompleted (bool isSuccessfulvoidstring errorText)
verifyAndAuthMessageAPI (string apiDatavoidstring xyzChallenge)
verifyAndAuthCompleted (bool isSuccessfulvoidstring errorText)
displayGroupList (int reqIdvoidstring groups)
displayGroupUpdated (int reqIdvoidstring contractInfo)
connectAck ()voidcallback initially acknowledging connection attempt connection handshake not complete until nextValidID is received
positionMulti (int requestIdvoidstring account
positionMultiEnd (int requestId)voidIndicates all the positions have been transmitted. More…
accountUpdateMulti (int requestIdvoidstring account
accountUpdateMultiEnd (int requestId)voidIndicates all the account updates have been transmitted. More…
securityDefinitionOptionParameter (int reqIdvoidstring exchange
securityDefinitionOptionParameterEnd (int reqId)voidcalled when all callbacks to securityDefinitionOptionParameter are complete More…
softDollarTiers (int reqIdvoidSoftDollarTier[] tiers)
familyCodes (FamilyCode[] familyCodes)voidreturns array of family codes More…
symbolSamples (int reqIdvoidContractDescription[] contractDescriptions)
mktDepthExchanges (DepthMktDataDescription[] depthMktDataDescriptions)voidcalled when receives Depth Market Data Descriptions More…
tickNews (int tickerIdvoidlong timeStamp
smartComponents (int reqIdvoidDictionary< int
tickReqParams (int tickerIdvoiddouble minTick
newsProviders (NewsProvider[] newsProviders)voidreturns array of subscribed API news providers for this user More…
newsArticle (int requestIdvoidint articleType
historicalNews (int requestIdvoidstring time
historicalNewsEnd (int requestIdvoidbool hasMore)
headTimestamp (int reqIdvoidstring headTimestamp)
Nonereturns beginning of data for contract for specified data typeNone
NoneMore…None
histogramData (int reqIdvoidHistogramEntry[] data)
rerouteMktDataReq (int reqIdvoidint conId
Nonereturns conId and exchange for CFD market data request re-routeNone
NoneMore…None
rerouteMktDepthReq (int reqIdvoidint conId
marketRule (int marketRuleIdvoidPriceIncrement[] priceIncrements)
pnl (int reqIdvoiddouble dailyPnL
pnlSingle (int reqIdvoiddecimal pos
historicalTicks (int reqIdvoidHistoricalTick[] ticks
historicalTicksBidAsk (int reqIdvoidHistoricalTickBidAsk[] ticks
historicalTicksLast (int reqIdvoidHistoricalTickLast[] ticks
tickByTickAllLast (int reqIdvoidint tickType
tickByTickBidAsk (int reqIdvoidlong time
tickByTickMidPoint (int reqIdvoidlong time
orderBound (long orderIdvoidint apiClientId
completedOrder (Contract contractvoidOrder order
completedOrdersEnd ()voidNotifies the end of the completed orders’ reception. More…
replaceFAEnd (int reqIdvoidstring text)
wshMetaData (int reqIdvoidstring dataJson)
wshEventData (int reqIdvoidstring dataJson)
historicalSchedule (int reqIdvoidstring startDateTime
userInfo (int reqIdvoidstring whiteBrandingId)