Skip to content

Commit 3147bc0

Browse files
committed
[EN-1454] quote listener extended
1 parent e8d27ee commit 3147bc0

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

dxfeed/core/listeners/listener.pyx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ cdef void trade_default_listener(int event_type,
4141
trades[i].is_eth,
4242
trades[i].scope])
4343

44-
QUOTE_COLUMNS = ['Symbol', 'BidTime', 'BidExchangeCode', 'BidPrice', 'BidSize', 'AskTime', 'AskExchangeCode',
44+
QUOTE_COLUMNS = ['Symbol', 'Sequence', 'Time', 'Nanos', 'BidTime', 'BidExchangeCode', 'BidPrice', 'BidSize', 'AskTime', 'AskExchangeCode',
4545
'AskPrice', 'AskSize', 'Scope']
4646
cdef void quote_default_listener(int event_type,
4747
dxf_const_string_t symbol_name,
@@ -54,6 +54,9 @@ cdef void quote_default_listener(int event_type,
5454

5555
for i in range(data_count):
5656
py_data.__update([unicode_from_dxf_const_string_t(symbol_name),
57+
quotes[i].sequence,
58+
quotes[i].time,
59+
quotes[i].time_nanos,
5760
quotes[i].bid_time,
5861
unicode_from_dxf_const_string_t(&quotes[i].bid_exchange_code),
5962
quotes[i].bid_price,

examples/AllSubscriptionsExample.ipynb

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,58 @@
7777
"trade_sub.get_event_handler().get_dataframe().head(3)"
7878
]
7979
},
80+
{
81+
"cell_type": "markdown",
82+
"metadata": {},
83+
"source": [
84+
"### Quote\n",
85+
"Details: https://kb.dxfeed.com/display/DS/dxFeed+API+Market+Events#dxFeedAPIMarketEvents-Quote"
86+
]
87+
},
88+
{
89+
"cell_type": "code",
90+
"execution_count": null,
91+
"metadata": {},
92+
"outputs": [],
93+
"source": [
94+
"quote_sub = endpoint.create_subscription('Quote').add_symbols(symbols)"
95+
]
96+
},
97+
{
98+
"cell_type": "code",
99+
"execution_count": null,
100+
"metadata": {},
101+
"outputs": [],
102+
"source": [
103+
"quote_sub.get_event_handler().get_dataframe().head(3)"
104+
]
105+
},
106+
{
107+
"cell_type": "markdown",
108+
"metadata": {},
109+
"source": [
110+
"### Order\n",
111+
"Details: https://kb.dxfeed.com/display/DS/dxFeed+API+Market+Events#dxFeedAPIMarketEvents-Orders"
112+
]
113+
},
114+
{
115+
"cell_type": "code",
116+
"execution_count": null,
117+
"metadata": {},
118+
"outputs": [],
119+
"source": [
120+
"order_sub = endpoint.create_subscription('Order').add_symbols(symbols)"
121+
]
122+
},
123+
{
124+
"cell_type": "code",
125+
"execution_count": null,
126+
"metadata": {},
127+
"outputs": [],
128+
"source": [
129+
"order_sub.get_event_handler().get_dataframe().head(3)"
130+
]
131+
},
80132
{
81133
"cell_type": "markdown",
82134
"metadata": {},

0 commit comments

Comments
 (0)