Receive Live Data

View as MarkdownOpen in Claude

Note: Please be aware that in the event subsequent orders are received with the same price value, but different size values, no new tickPrice value should be returned. Only an updated tickSize will denote that a new order was retrieved with the assumption the last tickPrice value will also correlate with the new size.

EWrapper.tickGeneric (

tickerId: int. Request identifier used to track data.

field: int. The type of tick being received.

value: double. Return value corresponding to value. See Available Tick Types for more details.
)

Returns generic data back to requester. Used for an array of tick types and is used to represent general evaluations.

1def tickGeneric(self, reqId: TickerId, tickType: TickType, value: float):
2 print("TickGeneric. TickerId:", reqId, "TickType:", tickType, "Value:", floatMaxString(value))

EWrapper.tickPrice (

tickerId: int. Request identifier used to track data.

tickType: int. The type of the price being received (See Tick ID field in [Available Tick Types](/tws-api/doc/market-data-live/available-tick-types/introduction)).

price: double. The monetary value for the given tick type.

attribs: TickAttrib. A TickAttrib object that contains price attributes such as TickAttrib::CanAutoExecute, TickAttrib::PastLimit and TickAttrib::PreOpen.
)

Market data tick price callback. Handles all price related ticks. Every tickPrice callback is followed by a tickSize. A tickPrice value of -1 or 0 followed by a tickSize of 0 indicates there is no data for this field currently available, whereas a tickPrice with a positive tickSize indicates an active quote of 0 (typically for a combo contract).

1def tickPrice(self, reqId: TickerId, tickType: TickType, price: float, attrib: TickAttrib):
2 print(reqId, tickType, price, attrib)

EWrapper.tickSize (

tickerId: int. Request identifier used to track data.

field: int. the type of size being received (i.e. bid size)

size: Decimal. the actual size. US stocks have a multiplier of 100.
)

Market data tick size callback. Handles all size-related ticks.

1def tickSize(self, reqId: TickerId, tickType: TickType, size: Decimal):
2 print("TickSize. TickerId:", reqId, "TickType:", tickType, "Size: ", decimalMaxString(size))

EWrapper.tickString (

tickerId: int. Request identifier used to track data.

field: int. The type of the tick being received

value: String. Variable containining message response.
)

Market data callback.

Note: Every tickPrice is followed by a tickSize. There are also independent tickSize callbacks anytime the tickSize changes, and so there will be duplicate tickSize messages following a tickPrice.

1def tickString(self, reqId: TickerId, tickType: TickType, value: str):
2 print("TickString. TickerId:", reqId, "Type:", tickType, "Value:", value)