Receive Tick By Tick Data

View as MarkdownOpen in Claude

EWrapper.tickByTickAllLast (

reqId: int. unique identifier of the request.

tickType: int. 1: “Last” or 2: “AllLast”.

time: long. tick-by-tick real-time tick timestamp.

price: double. tick-by-tick real-time tick last price.

size: decimal. tick-by-tick real-time tick last size.

tickAttribLast: TickAttribLast. tick-by-tick real-time last tick attribs (bit 0 – past limit, bit 1 – unreported).

exchange: String. tick-by-tick real-time tick exchange.

specialConditions: String. tick-by-tick real-time tick special conditions. Conditions under which the operation took place (Refer to Trade Conditions Page)
)

Returns “Last” or “AllLast” tick-by-tick real-time tick.

1def tickByTickAllLast(self, reqId: int, tickType: int, time: int, price: float, size: Decimal, tickAtrribLast: TickAttribLast, exchange: str,specialConditions: str):
2 print(" ReqId:", reqId, "Time:", time, "Price:", floatMaxString(price), "Size:", size, "Exch:" , exchange, "Spec Cond:", specialConditions, "PastLimit:", tickAtrribLast.pastLimit, "Unreported:", tickAtrribLast.unreported)

EWrapper.tickByTickBidAsk (

reqId: int. unique identifier of the request.

time: long. timestamp of the tick.

bidPrice: double. bid price of the tick.

askPrice: double. ask price of the tick.

bidSize: decimal. bid size of the tick.

askSize: decimal. ask size of the tick.

tickAttribBidAsk: TickAttribBidAsk. tick-by-tick real-time bid/ask tick attribs (bit 0 – bid past low, bit 1 – ask past high).
)

Returns “BidAsk” tick-by-tick real-time tick.

1 def tickByTickBidAsk(self, reqId: int, time: int, bidPrice: float, askPrice: float, bidSize: Decimal, askSize: Decimal, tickAttribBidAsk: TickAttribBidAsk):
2 print("BidAsk. ReqId:", reqId, "Time:", time, "BidPrice:", floatMaxString(bidPrice), "AskPrice:", floatMaxString(askPrice), "BidSize:", decimalMaxString(bidSize), "AskSize:", decimalMaxString(askSize), "BidPastLow:", tickAttribBidAsk.bidPastLow, "AskPastHigh:", tickAttribBidAsk.askPastHigh)

EWrapper.tickByTickMidPoint (

reqId: int. Request identifier used to track data.

time: long. Timestamp of the tick.

midPoint: double. Mid point value of the tick.
)

Returns “MidPoint” tick-by-tick real-time tick.

1def tickByTickMidPoint(self, reqId: int, time: int, midPoint: float):
2 print("Midpoint. ReqId:", reqId, "Time:", time, "MidPoint:", floatMaxString(midPoint))