LongPort OpenAPI C++ SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
quote_context.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "async_result.hpp"
4 #include "callback.hpp"
5 #include "config.hpp"
6 #include "push.hpp"
7 #include "types.hpp"
8 
10 
11 namespace longport {
12 namespace quote {
13 
16 {
17 private:
18  const lb_quote_context_t* ctx_;
19 
20 public:
26 
28 
29  size_t ref_count() const;
30 
31  static void create(const Config& config,
33 
35  int64_t member_id();
36 
38  std::string quote_level() const;
39 
42  const std::vector<std::string>& symbols,
43  AsyncCallback<QuoteContext, std::vector<QuotePackageDetail>> callback)
44  const;
45 
47  void subscribe(const std::vector<std::string>& symbols,
48  SubFlags sub_flags,
49  bool is_first_push,
50  AsyncCallback<QuoteContext, void> callback) const;
51 
53  void unsubscribe(const std::vector<std::string>& symbols,
54  SubFlags sub_flags,
55  AsyncCallback<QuoteContext, void> callback) const;
56 
59  const std::string& symbol,
60  Period period,
61  TradeSessions trade_sessions,
62  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
63 
66  const std::string& symbol,
67  Period period,
68  AsyncCallback<QuoteContext, void> callback) const;
69 
72  AsyncCallback<QuoteContext, std::vector<Subscription>> callback) const;
73 
77 
81 
85 
89 
94 
96  void static_info(const std::vector<std::string>& symbols,
97  AsyncCallback<QuoteContext, std::vector<SecurityStaticInfo>>
98  callback) const;
99 
101  void quote(
102  const std::vector<std::string>& symbols,
103  AsyncCallback<QuoteContext, std::vector<SecurityQuote>> callback) const;
104 
107  const std::vector<std::string>& symbols,
108  AsyncCallback<QuoteContext, std::vector<OptionQuote>> callback) const;
109 
112  const std::vector<std::string>& symbols,
113  AsyncCallback<QuoteContext, std::vector<WarrantQuote>> callback) const;
114 
116  void depth(const std::string& symbol,
118 
120  void brokers(const std::string& symbol,
122 
125  AsyncCallback<QuoteContext, std::vector<ParticipantInfo>> callback) const;
126 
128  void trades(const std::string& symbol,
129  uintptr_t count,
130  AsyncCallback<QuoteContext, std::vector<Trade>> callback) const;
131 
133  void intraday(
134  const std::string& symbol,
135  TradeSessions trade_sessions,
136  AsyncCallback<QuoteContext, std::vector<IntradayLine>> callback) const;
137 
140  const std::string& symbol,
141  Period period,
142  uintptr_t count,
143  AdjustType adjust_type,
144  TradeSessions trade_sessions,
145  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
146 
149  const std::string& symbol,
150  Period period,
151  AdjustType adjust_type,
152  bool forward,
153  std::optional<DateTime> datetime,
154  uintptr_t count,
155  TradeSessions trade_sessions,
156  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
157 
160  const std::string& symbol,
161  Period period,
162  AdjustType adjust_type,
163  std::optional<Date> start,
164  std::optional<Date> end,
165  TradeSessions trade_sessions,
166  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
167 
170  const std::string& symbol,
171  AsyncCallback<QuoteContext, std::vector<Date>> callback) const;
172 
175  const std::string& symbol,
176  Date expiry_date,
177  AsyncCallback<QuoteContext, std::vector<StrikePriceInfo>> callback) const;
178 
181  AsyncCallback<QuoteContext, std::vector<IssuerInfo>> callback) const;
182 
185  const std::string& symbol,
186  WarrantSortBy sort_by,
187  SortOrderType sort_order,
188  const std::vector<WarrantType>& warrant_type,
189  const std::vector<int32_t>& issuer,
190  const std::vector<FilterWarrantExpiryDate>& expiry_date,
191  const std::vector<FilterWarrantInOutBoundsType>& price_type,
192  const std::vector<WarrantStatus>& status,
193  AsyncCallback<QuoteContext, std::vector<WarrantInfo>> callback) const;
194 
197  AsyncCallback<QuoteContext, std::vector<MarketTradingSession>> callback)
198  const;
199 
204  void trading_days(Market market,
205  Date begin,
206  Date end,
208 
211  const std::string& symbol,
212  AsyncCallback<QuoteContext, std::vector<CapitalFlowLine>> callback) const;
213 
216  const std::string& symbol,
218 
221  const std::vector<std::string>& symbols,
222  const std::vector<CalcIndex>& indexes,
223  AsyncCallback<QuoteContext, std::vector<SecurityCalcIndex>> callback) const;
224 
226  void watchlist(
227  AsyncCallback<QuoteContext, std::vector<WatchlistGroup>> callback) const;
228 
231  const CreateWatchlistGroup& req,
232  AsyncCallback<QuoteContext, int64_t> callback) const;
233 
235  void delete_watchlist_group(int64_t id,
236  bool purge,
237  AsyncCallback<QuoteContext, void> callback) const;
238 
241  AsyncCallback<QuoteContext, void> callback) const;
242 
245  Market market,
246  SecurityListCategory category,
247  AsyncCallback<QuoteContext, std::vector<Security>> callback) const;
248 
251  Market market,
252  AsyncCallback<QuoteContext, std::vector<Security>> callback) const;
253 
256  Market market,
258 
261  Market market,
262  Date start,
263  Date end,
265  const;
266 
272  const std::vector<std::string>& symbols,
273  AsyncCallback<QuoteContext, std::vector<RealtimeQuote>> callback) const;
274 
280  const std::string& symbol,
282 
288  const std::string& symbol,
289  uint64_t count,
290  AsyncCallback<QuoteContext, std::vector<Trade>> callback) const;
291 
297  const std::string& symbol,
299 
305  const std::string& symbol,
306  Period period,
307  uintptr_t count,
308  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
309 };
310 
311 } // namespace quote
312 } // namespace longport
Definition: config.hpp:16
Quote context.
Definition: quote_context.hpp:16
void set_on_brokers(PushCallback< QuoteContext, PushBrokers > callback) const
void option_quote(const std::vector< std::string > &symbols, AsyncCallback< QuoteContext, std::vector< OptionQuote >> callback) const
Get quote of option securities.
void realtime_candlesticks(const std::string &symbol, Period period, uintptr_t count, AsyncCallback< QuoteContext, std::vector< Candlestick >> callback) const
void depth(const std::string &symbol, AsyncCallback< QuoteContext, SecurityDepth > callback) const
Get security depth.
void unsubscribe_candlesticks(const std::string &symbol, Period period, AsyncCallback< QuoteContext, void > callback) const
Unsubscribe security candlesticks.
void warrant_list(const std::string &symbol, WarrantSortBy sort_by, SortOrderType sort_order, const std::vector< WarrantType > &warrant_type, const std::vector< int32_t > &issuer, const std::vector< FilterWarrantExpiryDate > &expiry_date, const std::vector< FilterWarrantInOutBoundsType > &price_type, const std::vector< WarrantStatus > &status, AsyncCallback< QuoteContext, std::vector< WarrantInfo >> callback) const
Query warrant list.
void delete_watchlist_group(int64_t id, bool purge, AsyncCallback< QuoteContext, void > callback) const
Delete watchlist group.
QuoteContext(const lb_quote_context_t *ctx)
void option_chain_expiry_date_list(const std::string &symbol, AsyncCallback< QuoteContext, std::vector< Date >> callback) const
Get option chain expiry date list.
void security_list(Market market, SecurityListCategory category, AsyncCallback< QuoteContext, std::vector< Security >> callback) const
Get security list.
int64_t member_id()
Returns the member id.
void history_candlesticks_by_date(const std::string &symbol, Period period, AdjustType adjust_type, std::optional< Date > start, std::optional< Date > end, TradeSessions trade_sessions, AsyncCallback< QuoteContext, std::vector< Candlestick >> callback) const
Get security history candlesticks by date.
void watchlist(AsyncCallback< QuoteContext, std::vector< WatchlistGroup >> callback) const
Get watchlist.
void trading_days(Market market, Date begin, Date end, AsyncCallback< QuoteContext, MarketTradingDays > callback)
void history_market_temperature(Market market, Date start, Date end, AsyncCallback< QuoteContext, HistoryMarketTemperatureResponse > callback) const
Get historical market temperature.
void subscribe_candlesticks(const std::string &symbol, Period period, TradeSessions trade_sessions, AsyncCallback< QuoteContext, std::vector< Candlestick >> callback) const
Subscribe security candlesticks.
static void create(const Config &config, AsyncCallback< QuoteContext, void > callback)
void security_list(Market market, AsyncCallback< QuoteContext, std::vector< Security >> callback) const
Get security list without category.
void create_watchlist_group(const CreateWatchlistGroup &req, AsyncCallback< QuoteContext, int64_t > callback) const
Create watchlist group.
void realtime_quote(const std::vector< std::string > &symbols, AsyncCallback< QuoteContext, std::vector< RealtimeQuote >> callback) const
void realtime_depth(const std::string &symbol, AsyncCallback< QuoteContext, SecurityDepth > callback) const
void set_on_candlestick(PushCallback< QuoteContext, PushCandlestick > callback) const
void history_candlesticks_by_offset(const std::string &symbol, Period period, AdjustType adjust_type, bool forward, std::optional< DateTime > datetime, uintptr_t count, TradeSessions trade_sessions, AsyncCallback< QuoteContext, std::vector< Candlestick >> callback) const
Get security history candlesticks by offset.
void capital_flow(const std::string &symbol, AsyncCallback< QuoteContext, std::vector< CapitalFlowLine >> callback) const
Get capital flow intraday.
void set_on_quote(PushCallback< QuoteContext, PushQuote > callback) const
void set_on_depth(PushCallback< QuoteContext, PushDepth > callback) const
void set_on_trades(PushCallback< QuoteContext, PushTrades > callback) const
void trading_session(AsyncCallback< QuoteContext, std::vector< MarketTradingSession >> callback) const
Get trading session of the day.
void capital_distribution(const std::string &symbol, AsyncCallback< QuoteContext, CapitalDistributionResponse > callback) const
Get capital distribution.
void market_temperature(Market market, AsyncCallback< QuoteContext, MarketTemperature > callback) const
Get current market temperature.
void static_info(const std::vector< std::string > &symbols, AsyncCallback< QuoteContext, std::vector< SecurityStaticInfo >> callback) const
Get basic information of securities.
void subscriptions(AsyncCallback< QuoteContext, std::vector< Subscription >> callback) const
Get subscription information.
void candlesticks(const std::string &symbol, Period period, uintptr_t count, AdjustType adjust_type, TradeSessions trade_sessions, AsyncCallback< QuoteContext, std::vector< Candlestick >> callback) const
Get security candlesticks.
void subscribe(const std::vector< std::string > &symbols, SubFlags sub_flags, bool is_first_push, AsyncCallback< QuoteContext, void > callback) const
Subscribe.
void trades(const std::string &symbol, uintptr_t count, AsyncCallback< QuoteContext, std::vector< Trade >> callback) const
Get security trades.
void update_watchlist_group(const UpdateWatchlistGroup &req, AsyncCallback< QuoteContext, void > callback) const
Create watchlist group.
void unsubscribe(const std::vector< std::string > &symbols, SubFlags sub_flags, AsyncCallback< QuoteContext, void > callback) const
Unsubscribe.
void realtime_brokers(const std::string &symbol, AsyncCallback< QuoteContext, SecurityBrokers > callback) const
std::string quote_level() const
Returns the quote level.
QuoteContext(const QuoteContext &ctx)
void quote_package_details(const std::vector< std::string > &symbols, AsyncCallback< QuoteContext, std::vector< QuotePackageDetail >> callback) const
Returns the quote package details.
void participants(AsyncCallback< QuoteContext, std::vector< ParticipantInfo >> callback) const
Get participants.
void brokers(const std::string &symbol, AsyncCallback< QuoteContext, SecurityBrokers > callback) const
Get security brokers.
void realtime_trades(const std::string &symbol, uint64_t count, AsyncCallback< QuoteContext, std::vector< Trade >> callback) const
void quote(const std::vector< std::string > &symbols, AsyncCallback< QuoteContext, std::vector< SecurityQuote >> callback) const
Get quote of securities.
QuoteContext & operator=(const QuoteContext &ctx)
void warrant_quote(const std::vector< std::string > &symbols, AsyncCallback< QuoteContext, std::vector< WarrantQuote >> callback) const
Get quote of warrant securities.
void option_chain_info_by_date(const std::string &symbol, Date expiry_date, AsyncCallback< QuoteContext, std::vector< StrikePriceInfo >> callback) const
Get option chain expiry date list.
void calc_indexes(const std::vector< std::string > &symbols, const std::vector< CalcIndex > &indexes, AsyncCallback< QuoteContext, std::vector< SecurityCalcIndex >> callback) const
Get calc indexes.
QuoteContext(QuoteContext &&ctx)
void intraday(const std::string &symbol, TradeSessions trade_sessions, AsyncCallback< QuoteContext, std::vector< IntradayLine >> callback) const
Get security intraday lines.
void warrant_issuers(AsyncCallback< QuoteContext, std::vector< IssuerInfo >> callback) const
Get warrant issuers.
Subscription flags.
Definition: types.hpp:72
Period
Candlestick period.
Definition: types.hpp:130
AdjustType
Adjust type.
Definition: types.hpp:687
SecurityListCategory
Security list category.
Definition: types.hpp:1179
WarrantSortBy
Warrant sort by.
Definition: types.hpp:1042
SortOrderType
Sort order type.
Definition: types.hpp:1033
TradeSessions
Trade sessions.
Definition: types.hpp:1201
Definition: async_result.hpp:7
std::function< void(AsyncResult< Ctx, T >)> AsyncCallback
Definition: async_result.hpp:39
Market
Market.
Definition: types.hpp:51
std::function< void(PushEvent< Ctx, T >)> PushCallback
Definition: push.hpp:27
struct lb_quote_context_t lb_quote_context_t
Definition: quote_context.hpp:9
Definition: types.hpp:10
An request for create watchlist group.
Definition: types.hpp:816
An request for update watchlist group.
Definition: types.hpp:825