Q26 ALPHA-TRADING SYSTEM
|
Public Member Functions | |
def | __init__ (self) |
def | logAnswer (self, fnName, fnParams) |
def | error (self, TickerId reqId, int errorCode, str errorString) |
def | winError (self, str text, int lastError) |
def | connectAck (self) |
def | marketDataType (self, TickerId reqId, int marketDataType) |
def | tickPrice (self, TickerId reqId, TickType tickType, float price, TickAttrib attrib) |
def | tickSize (self, TickerId reqId, TickType tickType, int size) |
def | tickSnapshotEnd (self, int reqId) |
def | tickGeneric (self, TickerId reqId, TickType tickType, float value) |
def | tickString (self, TickerId reqId, TickType tickType, str value) |
def | tickEFP (self, TickerId reqId, TickType tickType, float basisPoints, str formattedBasisPoints, float totalDividends, int holdDays, str futureLastTradeDate, float dividendImpact, float dividendsToLastTradeDate) |
def | orderStatus (self, OrderId orderId, str status, float filled, float remaining, float avgFillPrice, int permId, int parentId, float lastFillPrice, int clientId, str whyHeld, float mktCapPrice) |
def | openOrder (self, OrderId orderId, Contract contract, Order order, OrderState orderState) |
def | openOrderEnd (self) |
def | connectionClosed (self) |
def | updateAccountValue (self, str key, str val, str currency, str accountName) |
def | updatePortfolio (self, Contract contract, float position, float marketPrice, float marketValue, float averageCost, float unrealizedPNL, float realizedPNL, str accountName) |
def | updateAccountTime (self, str timeStamp) |
def | accountDownloadEnd (self, str accountName) |
def | nextValidId (self, int orderId) |
def | contractDetails (self, int reqId, ContractDetails contractDetails) |
def | bondContractDetails (self, int reqId, ContractDetails contractDetails) |
def | contractDetailsEnd (self, int reqId) |
def | execDetails (self, int reqId, Contract contract, Execution execution) |
def | execDetailsEnd (self, int reqId) |
def | updateMktDepth (self, TickerId reqId, int position, int operation, int side, float price, int size) |
def | updateMktDepthL2 (self, TickerId reqId, int position, str marketMaker, int operation, int side, float price, int size, bool isSmartDepth) |
def | updateNewsBulletin (self, int msgId, int msgType, str newsMessage, str originExch) |
def | managedAccounts (self, str accountsList) |
def | receiveFA (self, FaDataType faData, str cxml) |
def | historicalData (self, int reqId, BarData bar) |
def | historicalDataEnd (self, int reqId, str start, str end) |
def | scannerParameters (self, str xml) |
def | scannerData (self, int reqId, int rank, ContractDetails contractDetails, str distance, str benchmark, str projection, str legsStr) |
def | scannerDataEnd (self, int reqId) |
def | realtimeBar (self, TickerId reqId, int time, float open_, float high, float low, float close, int volume, float wap, int count) |
def | currentTime (self, int time) |
def | fundamentalData (self, TickerId reqId, str data) |
def | deltaNeutralValidation (self, int reqId, DeltaNeutralContract deltaNeutralContract) |
def | commissionReport (self, CommissionReport commissionReport) |
def | position (self, str account, Contract contract, float position, float avgCost) |
def | positionEnd (self) |
def | accountSummary (self, int reqId, str account, str tag, str value, str currency) |
def | accountSummaryEnd (self, int reqId) |
def | verifyMessageAPI (self, str apiData) |
def | verifyCompleted (self, bool isSuccessful, str errorText) |
def | verifyAndAuthMessageAPI (self, str apiData, str xyzChallange) |
def | verifyAndAuthCompleted (self, bool isSuccessful, str errorText) |
def | displayGroupList (self, int reqId, str groups) |
def | displayGroupUpdated (self, int reqId, str contractInfo) |
def | positionMulti (self, int reqId, str account, str modelCode, Contract contract, float pos, float avgCost) |
def | positionMultiEnd (self, int reqId) |
def | accountUpdateMulti (self, int reqId, str account, str modelCode, str key, str value, str currency) |
def | accountUpdateMultiEnd (self, int reqId) |
def | tickOptionComputation (self, TickerId reqId, TickType tickType, float impliedVol, float delta, float optPrice, float pvDividend, float gamma, float vega, float theta, float undPrice) |
def | securityDefinitionOptionParameter (self, int reqId, str exchange, int underlyingConId, str tradingClass, str multiplier, SetOfString expirations, SetOfFloat strikes) |
def | securityDefinitionOptionParameterEnd (self, int reqId) |
def | softDollarTiers (self, int reqId, list tiers) |
def | familyCodes (self, ListOfFamilyCode familyCodes) |
def | symbolSamples (self, int reqId, ListOfContractDescription contractDescriptions) |
def | mktDepthExchanges (self, ListOfDepthExchanges depthMktDataDescriptions) |
def | tickNews (self, int tickerId, int timeStamp, str providerCode, str articleId, str headline, str extraData) |
def | smartComponents (self, int reqId, SmartComponentMap smartComponentMap) |
def | tickReqParams (self, int tickerId, float minTick, str bboExchange, int snapshotPermissions) |
def | newsProviders (self, ListOfNewsProviders newsProviders) |
def | newsArticle (self, int requestId, int articleType, str articleText) |
def | historicalNews (self, int requestId, str time, str providerCode, str articleId, str headline) |
def | historicalNewsEnd (self, int requestId, bool hasMore) |
def | headTimestamp (self, int reqId, str headTimestamp) |
def | histogramData (self, int reqId, HistogramData items) |
def | historicalDataUpdate (self, int reqId, BarData bar) |
def | rerouteMktDataReq (self, int reqId, int conId, str exchange) |
def | rerouteMktDepthReq (self, int reqId, int conId, str exchange) |
def | marketRule (self, int marketRuleId, ListOfPriceIncrements priceIncrements) |
def | pnl (self, int reqId, float dailyPnL, float unrealizedPnL, float realizedPnL) |
def | pnlSingle (self, int reqId, int pos, float dailyPnL, float unrealizedPnL, float realizedPnL, float value) |
def | historicalTicks (self, int reqId, ListOfHistoricalTick ticks, bool done) |
def | historicalTicksBidAsk (self, int reqId, ListOfHistoricalTickBidAsk ticks, bool done) |
def | historicalTicksLast (self, int reqId, ListOfHistoricalTickLast ticks, bool done) |
def | tickByTickAllLast (self, int reqId, int tickType, int time, float price, int size, TickAttribLast tickAttribLast, str exchange, str specialConditions) |
def | tickByTickBidAsk (self, int reqId, int time, float bidPrice, float askPrice, int bidSize, int askSize, TickAttribBidAsk tickAttribBidAsk) |
def | tickByTickMidPoint (self, int reqId, int time, float midPoint) |
def | orderBound (self, int reqId, int apiClientId, int apiOrderId) |
def | completedOrder (self, Contract contract, Order order, OrderState orderState) |
def | completedOrdersEnd (self) |
def accountDownloadEnd | ( | self, | |
str | accountName | ||
) |
This is called after a batch updateAccountValue() and updatePortfolio() is sent.
def accountSummary | ( | self, | |
int | reqId, | ||
str | account, | ||
str | tag, | ||
str | value, | ||
str | currency | ||
) |
Returns the data from the TWS Account Window Summary tab in response to reqAccountSummary().
def accountSummaryEnd | ( | self, | |
int | reqId | ||
) |
This method is called once all account summary data for a given request are received.
def accountUpdateMulti | ( | self, | |
int | reqId, | ||
str | account, | ||
str | modelCode, | ||
str | key, | ||
str | value, | ||
str | currency | ||
) |
same as updateAccountValue() except it can be for a certain account/model
def accountUpdateMultiEnd | ( | self, | |
int | reqId | ||
) |
same as accountDownloadEnd() except it can be for a certain account/model
def bondContractDetails | ( | self, | |
int | reqId, | ||
ContractDetails | contractDetails | ||
) |
This function is called when reqContractDetails function has been called for bonds.
def commissionReport | ( | self, | |
CommissionReport | commissionReport | ||
) |
The commissionReport() callback is triggered as follows: - immediately after a trade execution - by calling reqExecutions().
def completedOrder | ( | self, | |
Contract | contract, | ||
Order | order, | ||
OrderState | orderState | ||
) |
This function is called to feed in completed orders. contract: Contract - The Contract class attributes describe the contract. order: Order - The Order class gives the details of the completed order. orderState: OrderState - The orderState class includes completed order status details.
def completedOrdersEnd | ( | self | ) |
This is called at the end of a given request for completed orders.
def connectAck | ( | self | ) |
callback signifying completion of successful connection
def connectionClosed | ( | self | ) |
This function is called when TWS closes the sockets connection with the ActiveX control, or when TWS is shut down.
def contractDetails | ( | self, | |
int | reqId, | ||
ContractDetails | contractDetails | ||
) |
Receives the full contract's definitions. This method will return all contracts matching the requested via EEClientSocket::reqContractDetails. For example, one can obtain the whole option chain with it.
def contractDetailsEnd | ( | self, | |
int | reqId | ||
) |
This function is called once all contract details for a given request are received. This helps to define the end of an option chain.
def currentTime | ( | self, | |
int | time | ||
) |
Server's current time. This method will receive IB server's system time resulting after the invokation of reqCurrentTime.
def deltaNeutralValidation | ( | self, | |
int | reqId, | ||
DeltaNeutralContract | deltaNeutralContract | ||
) |
Upon accepting a Delta-Neutral RFQ(request for quote), the server sends a deltaNeutralValidation() message with the DeltaNeutralContract structure. If the delta and price fields are empty in the original request, the confirmation will contain the current values from the server. These values are locked when the RFQ is processed and remain locked until the RFQ is canceled.
def displayGroupList | ( | self, | |
int | reqId, | ||
str | groups | ||
) |
This callback is a one-time response to queryDisplayGroups(). reqId - The requestId specified in queryDisplayGroups(). groups - A list of integers representing visible group ID separated by the | character, and sorted by most used group first. This list will not change during TWS session (in other words, user cannot add a new group; sorting can change though).
def displayGroupUpdated | ( | self, | |
int | reqId, | ||
str | contractInfo | ||
) |
This is sent by TWS to the API client once after receiving the subscription request subscribeToGroupEvents(), and will be sent again if the selected contract in the subscribed display group has changed. requestId - The requestId specified in subscribeToGroupEvents(). contractInfo - The encoded value that uniquely represents the contract in IB. Possible values include: none = empty selection contractID@exchange = any non-combination contract. Examples: 8314@SMART for IBM SMART; 8314@ARCA for IBM @ARCA. combo = if any combo is selected.
def error | ( | self, | |
TickerId | reqId, | ||
int | errorCode, | ||
str | errorString | ||
) |
This event is called when there is an error with the communication or when TWS wants to send a message to the client.
This event is fired when the reqExecutions() functions is invoked, or when an order is filled.
def execDetailsEnd | ( | self, | |
int | reqId | ||
) |
This function is called once all executions have been sent to a client in response to reqExecutions().
def familyCodes | ( | self, | |
ListOfFamilyCode | familyCodes | ||
) |
returns array of family codes
def fundamentalData | ( | self, | |
TickerId | reqId, | ||
str | data | ||
) |
This function is called to receive fundamental market data. The appropriate market data subscription must be set up in Account Management before you can receive this data.
def headTimestamp | ( | self, | |
int | reqId, | ||
str | headTimestamp | ||
) |
returns earliest available data of a type of data for a particular contract
def histogramData | ( | self, | |
int | reqId, | ||
HistogramData | items | ||
) |
returns histogram data for a contract
def historicalData | ( | self, | |
int | reqId, | ||
BarData | bar | ||
) |
returns the requested historical data bars reqId - the request's identifier date - the bar's date and time (either as a yyyymmss hh:mm:ssformatted string or as system time according to the request) open - the bar's open point high - the bar's high point low - the bar's low point close - the bar's closing point volume - the bar's traded volume if available count - the number of trades during the bar's timespan (only available for TRADES). WAP - the bar's Weighted Average Price hasGaps -indicates if the data has gaps or not.
def historicalDataEnd | ( | self, | |
int | reqId, | ||
str | start, | ||
str | end | ||
) |
Marks the ending of the historical bars reception.
def historicalDataUpdate | ( | self, | |
int | reqId, | ||
BarData | bar | ||
) |
returns updates in real time when keepUpToDate is set to True
def historicalNews | ( | self, | |
int | requestId, | ||
str | time, | ||
str | providerCode, | ||
str | articleId, | ||
str | headline | ||
) |
returns historical news headlines
def historicalNewsEnd | ( | self, | |
int | requestId, | ||
bool | hasMore | ||
) |
signals end of historical news
def historicalTicks | ( | self, | |
int | reqId, | ||
ListOfHistoricalTick | ticks, | ||
bool | done | ||
) |
returns historical tick data when whatToShow=MIDPOINT
def historicalTicksBidAsk | ( | self, | |
int | reqId, | ||
ListOfHistoricalTickBidAsk | ticks, | ||
bool | done | ||
) |
returns historical tick data when whatToShow=BID_ASK
def historicalTicksLast | ( | self, | |
int | reqId, | ||
ListOfHistoricalTickLast | ticks, | ||
bool | done | ||
) |
returns historical tick data when whatToShow=TRADES
def managedAccounts | ( | self, | |
str | accountsList | ||
) |
Receives a comma-separated string with the managed account ids.
def marketDataType | ( | self, | |
TickerId | reqId, | ||
int | marketDataType | ||
) |
TWS sends a marketDataType(type) callback to the API, where type is set to Frozen or RealTime, to announce that market data has been switched between frozen and real-time. This notification occurs only when market data switches between real-time and frozen. The marketDataType( ) callback accepts a reqId parameter and is sent per every subscription because different contracts can generally trade on a different schedule.
def marketRule | ( | self, | |
int | marketRuleId, | ||
ListOfPriceIncrements | priceIncrements | ||
) |
returns minimum price increment structure for a particular market rule ID
def mktDepthExchanges | ( | self, | |
ListOfDepthExchanges | depthMktDataDescriptions | ||
) |
returns array of exchanges which return depth to UpdateMktDepthL2
def newsArticle | ( | self, | |
int | requestId, | ||
int | articleType, | ||
str | articleText | ||
) |
returns body of news article
def newsProviders | ( | self, | |
ListOfNewsProviders | newsProviders | ||
) |
returns available, subscribed API news providers
def nextValidId | ( | self, | |
int | orderId | ||
) |
Receives next valid order id.
def openOrder | ( | self, | |
OrderId | orderId, | ||
Contract | contract, | ||
Order | order, | ||
OrderState | orderState | ||
) |
This function is called to feed in open orders. orderID: OrderId - The order ID assigned by TWS. Use to cancel or update TWS order. contract: Contract - The Contract class attributes describe the contract. order: Order - The Order class gives the details of the open order. orderState: OrderState - The orderState class includes attributes Used for both pre and post trade margin and commission data.
def openOrderEnd | ( | self | ) |
This is called at the end of a given request for open orders.
def orderBound | ( | self, | |
int | reqId, | ||
int | apiClientId, | ||
int | apiOrderId | ||
) |
returns orderBound notification
def orderStatus | ( | self, | |
OrderId | orderId, | ||
str | status, | ||
float | filled, | ||
float | remaining, | ||
float | avgFillPrice, | ||
int | permId, | ||
int | parentId, | ||
float | lastFillPrice, | ||
int | clientId, | ||
str | whyHeld, | ||
float | mktCapPrice | ||
) |
This event is called whenever the status of an order changes. It is also fired after reconnecting to TWS if the client has any open orders. orderId: OrderId - The order ID that was specified previously in the call to placeOrder() status:str - The order status. Possible values include: PendingSubmit - indicates that you have transmitted the order, but have not yet received confirmation that it has been accepted by the order destination. NOTE: This order status is not sent by TWS and should be explicitly set by the API developer when an order is submitted. PendingCancel - indicates that you have sent a request to cancel the order but have not yet received cancel confirmation from the order destination. At this point, your order is not confirmed canceled. You may still receive an execution while your cancellation request is pending. NOTE: This order status is not sent by TWS and should be explicitly set by the API developer when an order is canceled. PreSubmitted - indicates that a simulated order type has been accepted by the IB system and that this order has yet to be elected. The order is held in the IB system until the election criteria are met. At that time the order is transmitted to the order destination as specified. Submitted - indicates that your order has been accepted at the order destination and is working. Cancelled - indicates that the balance of your order has been confirmed canceled by the IB system. This could occur unexpectedly when IB or the destination has rejected your order. Filled - indicates that the order has been completely filled. Inactive - indicates that the order has been accepted by the system (simulated orders) or an exchange (native orders) but that currently the order is inactive due to system, exchange or other issues. filled:int - Specifies the number of shares that have been executed. For more information about partial fills, see Order Status for Partial Fills. remaining:int - Specifies the number of shares still outstanding. avgFillPrice:float - The average price of the shares that have been executed. This parameter is valid only if the filled parameter value is greater than zero. Otherwise, the price parameter will be zero. permId:int - The TWS id used to identify orders. Remains the same over TWS sessions. parentId:int - The order ID of the parent order, used for bracket and auto trailing stop orders. lastFilledPrice:float - The last price of the shares that have been executed. This parameter is valid only if the filled parameter value is greater than zero. Otherwise, the price parameter will be zero. clientId:int - The ID of the client (or TWS) that placed the order. Note that TWS orders have a fixed clientId and orderId of 0 that distinguishes them from API orders. whyHeld:str - This field is used to identify an order held when TWS is trying to locate shares for a short sell. The value used to indicate this is 'locate'.
def pnl | ( | self, | |
int | reqId, | ||
float | dailyPnL, | ||
float | unrealizedPnL, | ||
float | realizedPnL | ||
) |
returns the daily PnL for the account
def pnlSingle | ( | self, | |
int | reqId, | ||
int | pos, | ||
float | dailyPnL, | ||
float | unrealizedPnL, | ||
float | realizedPnL, | ||
float | value | ||
) |
returns the daily PnL for a single position in the account
def position | ( | self, | |
str | account, | ||
Contract | contract, | ||
float | position, | ||
float | avgCost | ||
) |
This event returns real-time positions for all accounts in response to the reqPositions() method.
def positionEnd | ( | self | ) |
This is called once all position data for a given request are received and functions as an end marker for the position() data.
def positionMulti | ( | self, | |
int | reqId, | ||
str | account, | ||
str | modelCode, | ||
Contract | contract, | ||
float | pos, | ||
float | avgCost | ||
) |
same as position() except it can be for a certain account/model
def positionMultiEnd | ( | self, | |
int | reqId | ||
) |
same as positionEnd() except it can be for a certain account/model
def realtimeBar | ( | self, | |
TickerId | reqId, | ||
int | time, | ||
float | open_, | ||
float | high, | ||
float | low, | ||
float | close, | ||
int | volume, | ||
float | wap, | ||
int | count | ||
) |
Updates the real time 5 seconds bars reqId - the request's identifier bar.time - start of bar in unix (or 'epoch') time bar.endTime - for synthetic bars, the end time (requires TWS v964). Otherwise -1. bar.open_ - the bar's open value bar.high - the bar's high value bar.low - the bar's low value bar.close - the bar's closing value bar.volume - the bar's traded volume if available bar.WAP - the bar's Weighted Average Price bar.count - the number of trades during the bar's timespan (only available for TRADES).
def receiveFA | ( | self, | |
FaDataType | faData, | ||
str | cxml | ||
) |
receives the Financial Advisor's configuration available in the TWS faDataType - one of: Groups: offer traders a way to create a group of accounts and apply a single allocation method to all accounts in the group. Profiles: let you allocate shares on an account-by-account basis using a predefined calculation value. Account Aliases: let you easily identify the accounts by meaningful names rather than account numbers. faXmlData - the xml-formatted configuration
def rerouteMktDataReq | ( | self, | |
int | reqId, | ||
int | conId, | ||
str | exchange | ||
) |
returns reroute CFD contract information for market data request
def rerouteMktDepthReq | ( | self, | |
int | reqId, | ||
int | conId, | ||
str | exchange | ||
) |
returns reroute CFD contract information for market depth request
def scannerData | ( | self, | |
int | reqId, | ||
int | rank, | ||
ContractDetails | contractDetails, | ||
str | distance, | ||
str | benchmark, | ||
str | projection, | ||
str | legsStr | ||
) |
Provides the data resulting from the market scanner request. reqid - the request's identifier. rank - the ranking within the response of this bar. contractDetails - the data's ContractDetails distance - according to query. benchmark - according to query. projection - according to query. legStr - describes the combo legs when the scanner is returning EFP
def scannerDataEnd | ( | self, | |
int | reqId | ||
) |
Indicates the scanner data reception has terminated. reqId - the request's identifier
def scannerParameters | ( | self, | |
str | xml | ||
) |
Provides the xml-formatted parameters available to create a market scanner. xml - the xml-formatted string with the available parameters.
def securityDefinitionOptionParameter | ( | self, | |
int | reqId, | ||
str | exchange, | ||
int | underlyingConId, | ||
str | tradingClass, | ||
str | multiplier, | ||
SetOfString | expirations, | ||
SetOfFloat | strikes | ||
) |
Returns the option chain for an underlying on an exchange specified in reqSecDefOptParams There will be multiple callbacks to securityDefinitionOptionParameter if multiple exchanges are specified in reqSecDefOptParams reqId - ID of the request initiating the callback underlyingConId - The conID of the underlying security tradingClass - the option trading class multiplier - the option multiplier expirations - a list of the expiries for the options of this underlying on this exchange strikes - a list of the possible strikes for options of this underlying on this exchange
def securityDefinitionOptionParameterEnd | ( | self, | |
int | reqId | ||
) |
Called when all callbacks to securityDefinitionOptionParameter are complete reqId - the ID used in the call to securityDefinitionOptionParameter
def smartComponents | ( | self, | |
int | reqId, | ||
SmartComponentMap | smartComponentMap | ||
) |
returns exchange component mapping
def softDollarTiers | ( | self, | |
int | reqId, | ||
list | tiers | ||
) |
Called when receives Soft Dollar Tier configuration information reqId - The request ID used in the call to EEClient::reqSoftDollarTiers tiers - Stores a list of SoftDollarTier that contains all Soft Dollar Tiers information
def symbolSamples | ( | self, | |
int | reqId, | ||
ListOfContractDescription | contractDescriptions | ||
) |
returns array of sample contract descriptions
def tickByTickAllLast | ( | self, | |
int | reqId, | ||
int | tickType, | ||
int | time, | ||
float | price, | ||
int | size, | ||
TickAttribLast | tickAttribLast, | ||
str | exchange, | ||
str | specialConditions | ||
) |
returns tick-by-tick data for tickType = "Last" or "AllLast"
def tickByTickBidAsk | ( | self, | |
int | reqId, | ||
int | time, | ||
float | bidPrice, | ||
float | askPrice, | ||
int | bidSize, | ||
int | askSize, | ||
TickAttribBidAsk | tickAttribBidAsk | ||
) |
returns tick-by-tick data for tickType = "BidAsk"
def tickByTickMidPoint | ( | self, | |
int | reqId, | ||
int | time, | ||
float | midPoint | ||
) |
returns tick-by-tick data for tickType = "MidPoint"
def tickNews | ( | self, | |
int | tickerId, | ||
int | timeStamp, | ||
str | providerCode, | ||
str | articleId, | ||
str | headline, | ||
str | extraData | ||
) |
returns news headlines
def tickOptionComputation | ( | self, | |
TickerId | reqId, | ||
TickType | tickType, | ||
float | impliedVol, | ||
float | delta, | ||
float | optPrice, | ||
float | pvDividend, | ||
float | gamma, | ||
float | vega, | ||
float | theta, | ||
float | undPrice | ||
) |
This function is called when the market in an option or its underlier moves. TWS's option model volatilities, prices, and deltas, along with the present value of dividends expected on that options underlier are received.
def tickPrice | ( | self, | |
TickerId | reqId, | ||
TickType | tickType, | ||
float | price, | ||
TickAttrib | attrib | ||
) |
Market data tick price callback. Handles all price related ticks.
def tickReqParams | ( | self, | |
int | tickerId, | ||
float | minTick, | ||
str | bboExchange, | ||
int | snapshotPermissions | ||
) |
returns exchange map of a particular contract
def tickSize | ( | self, | |
TickerId | reqId, | ||
TickType | tickType, | ||
int | size | ||
) |
Market data tick size callback. Handles all size-related ticks.
def tickSnapshotEnd | ( | self, | |
int | reqId | ||
) |
When requesting market data snapshots, this market will indicate the snapshot reception is finished.
def updateAccountValue | ( | self, | |
str | key, | ||
str | val, | ||
str | currency, | ||
str | accountName | ||
) |
This function is called only when ReqAccountUpdates on EEClientSocket object has been called.
def updateMktDepth | ( | self, | |
TickerId | reqId, | ||
int | position, | ||
int | operation, | ||
int | side, | ||
float | price, | ||
int | size | ||
) |
Returns the order book. tickerId - the request's identifier position - the order book's row being updated operation - how to refresh the row: 0 = insert (insert this new order into the row identified by 'position') 1 = update (update the existing order in the row identified by 'position') 2 = delete (delete the existing order at the row identified by 'position'). side - 0 for ask, 1 for bid price - the order's price size - the order's size
def updateMktDepthL2 | ( | self, | |
TickerId | reqId, | ||
int | position, | ||
str | marketMaker, | ||
int | operation, | ||
int | side, | ||
float | price, | ||
int | size, | ||
bool | isSmartDepth | ||
) |
Returns the order book. tickerId - the request's identifier position - the order book's row being updated marketMaker - the exchange holding the order operation - how to refresh the row: 0 = insert (insert this new order into the row identified by 'position') 1 = update (update the existing order in the row identified by 'position') 2 = delete (delete the existing order at the row identified by 'position'). side - 0 for ask, 1 for bid price - the order's price size - the order's size isSmartDepth - is SMART Depth request
def updateNewsBulletin | ( | self, | |
int | msgId, | ||
int | msgType, | ||
str | newsMessage, | ||
str | originExch | ||
) |
provides IB's bulletins msgId - the bulletin's identifier msgType - one of: 1 - Regular news bulletin 2 - Exchange no longer available for trading 3 - Exchange is available for trading message - the message origExchange - the exchange where the message comes from.
def updatePortfolio | ( | self, | |
Contract | contract, | ||
float | position, | ||
float | marketPrice, | ||
float | marketValue, | ||
float | averageCost, | ||
float | unrealizedPNL, | ||
float | realizedPNL, | ||
str | accountName | ||
) |
This function is called only when reqAccountUpdates on EEClientSocket object has been called.
def verifyMessageAPI | ( | self, | |
str | apiData | ||
) |
Deprecated Function