class CompactData(CStruct): exchange = CUChar() token = CUInt() ltp = CUInt() change = CUInt() exchange_time_stamp = CUInt() volume = CUInt()
class SnapQuote(CStruct): exchange = CUChar() token = CUInt() buyers = CArray(5, CUInt) bid_prices = CArray(5, CUInt) bid_quantities = CArray(5, CUInt) sellers = CArray(5, CUInt) ask_prices = CArray(5, CUInt) ask_quantities = CArray(5, CUInt) exchange_time_stamp = CUInt()
class FullSnapQuote(CStruct): exchange = CUChar() token = CUInt() buyers = CArray(5, CUInt) bid_prices = CArray(5, CUInt) bid_quantities = CArray(5, CUInt) sellers = CArray(5, CUInt) ask_prices = CArray(5, CUInt) ask_quantities = CArray(5, CUInt) atp = CUInt() open = CUInt() high = CUInt() low = CUInt() close = CUInt() total_buy_quantity = CULong() total_sell_quantity = CULong() volume = CUInt()
class MarketData(CStruct): exchange = CUChar() token = CUInt() ltp = CUInt() ltt = CUInt() ltq = CUInt() volume = CUInt() best_bid_price = CUInt() best_bid_quantity = CUInt() best_ask_price = CUInt() best_ask_quantity = CUInt() total_buy_quantity = CULong() total_sell_quantity = CULong() atp = CUInt() exchange_time_stamp = CUInt() open = CUInt() high = CUInt() low = CUInt() close = CUInt() yearly_high = CUInt() yearly_low = CUInt()
class MarketStatus(CStruct): exchange = CUChar() length_of_market_type = CUShort() market_type = CString(length = "length_of_market_type") length_of_status = CUShort() status = CString(length = "length_of_status")
class ExchangeMessage(CStruct): exchange = CUChar() length = CUShort() message = CString(length = "length") exchange_time_stamp = CUInt()
class OpenInterest(CStruct): exchange = CUChar() token = CUInt() current_open_interest = CUChar() initial_open_interest = CUChar() exchange_time_stamp = CUInt()
class DPR(CStruct): exchange = CUChar() token = CUInt() exchange_time_stamp = CUInt() high = CUInt() low = CUInt()
class DataRow(CStruct): type = CUChar(always=ord('D')) length = CInt() num_fields = CUShort() column_values = CArray("num_fields", ColumnValue)
class ParameterStatus(CStruct): type = CUChar(always=ord('S')) length = CInt() parameter_name = CString(length=AUTOSIZED) parameter_value = CString(length=AUTOSIZED)
class EmptyQueryResponse(CStruct): type = CUChar(always=ord('I')) length = CInt(always=4)
class Query(CStruct): type = CUChar(always=ord('Q')) length = CInt() query = CString(length=AUTOSIZED)
class ReadyForQuery(CStruct): type = CUChar(default=b'Z') length = CInt(always=5) status = CUChar(default=b'I')
class AuthenticationOk(CStruct): type = CUChar(default=b'R') length = CInt(always=8) success = CInt(always=0)
class NoticeResponse(CStruct): type = CUChar(always=ord('N')) length = CInt() message = CString(length=AUTOSIZED)
class ErrorResponse(CStruct): type = CUChar(always=ord('E')) length = CInt() message = CString(length=AUTOSIZED)
class CommandComplete(CStruct): type = CUChar(always=ord('C')) length = CInt() tag = CString(length=AUTOSIZED)
class RowDescription(CStruct): type = CUChar(always=ord('T')) length = CInt() num_fields = CUShort() fields = CArray("num_fields", Row)