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  AsyncCallback<QuoteContext, std::vector<IntradayLine>> callback) const;
136 
139  const std::string& symbol,
140  Period period,
141  uintptr_t count,
142  AdjustType adjust_type,
143  TradeSessions trade_sessions,
144  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
145 
148  const std::string& symbol,
149  Period period,
150  AdjustType adjust_type,
151  bool forward,
152  std::optional<DateTime> datetime,
153  uintptr_t count,
154  TradeSessions trade_sessions,
155  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
156 
159  const std::string& symbol,
160  Period period,
161  AdjustType adjust_type,
162  std::optional<Date> start,
163  std::optional<Date> end,
164  TradeSessions trade_sessions,
165  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
166 
169  const std::string& symbol,
170  AsyncCallback<QuoteContext, std::vector<Date>> callback) const;
171 
174  const std::string& symbol,
175  Date expiry_date,
176  AsyncCallback<QuoteContext, std::vector<StrikePriceInfo>> callback) const;
177 
180  AsyncCallback<QuoteContext, std::vector<IssuerInfo>> callback) const;
181 
184  const std::string& symbol,
185  WarrantSortBy sort_by,
186  SortOrderType sort_order,
187  const std::vector<WarrantType>& warrant_type,
188  const std::vector<int32_t>& issuer,
189  const std::vector<FilterWarrantExpiryDate>& expiry_date,
190  const std::vector<FilterWarrantInOutBoundsType>& price_type,
191  const std::vector<WarrantStatus>& status,
192  AsyncCallback<QuoteContext, std::vector<WarrantInfo>> callback) const;
193 
196  AsyncCallback<QuoteContext, std::vector<MarketTradingSession>> callback)
197  const;
198 
203  void trading_days(Market market,
204  Date begin,
205  Date end,
207 
210  const std::string& symbol,
211  AsyncCallback<QuoteContext, std::vector<CapitalFlowLine>> callback) const;
212 
215  const std::string& symbol,
217 
220  const std::vector<std::string>& symbols,
221  const std::vector<CalcIndex>& indexes,
222  AsyncCallback<QuoteContext, std::vector<SecurityCalcIndex>> callback) const;
223 
225  void watchlist(
226  AsyncCallback<QuoteContext, std::vector<WatchlistGroup>> callback) const;
227 
230  const CreateWatchlistGroup& req,
231  AsyncCallback<QuoteContext, int64_t> callback) const;
232 
234  void delete_watchlist_group(int64_t id,
235  bool purge,
236  AsyncCallback<QuoteContext, void> callback) const;
237 
240  AsyncCallback<QuoteContext, void> callback) const;
241 
244  Market market,
245  SecurityListCategory category,
246  AsyncCallback<QuoteContext, std::vector<Security>> callback) const;
247 
250  Market market,
252 
255  Market market,
256  Date start,
257  Date end,
259  const;
260 
266  const std::vector<std::string>& symbols,
267  AsyncCallback<QuoteContext, std::vector<RealtimeQuote>> callback) const;
268 
274  const std::string& symbol,
276 
282  const std::string& symbol,
283  uint64_t count,
284  AsyncCallback<QuoteContext, std::vector<Trade>> callback) const;
285 
291  const std::string& symbol,
293 
299  const std::string& symbol,
300  Period period,
301  uintptr_t count,
302  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
303 };
304 
305 } // namespace quote
306 } // 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 intraday(const std::string &symbol, AsyncCallback< QuoteContext, std::vector< IntradayLine >> callback) const
Get security intraday lines.
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 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 warrant_issuers(AsyncCallback< QuoteContext, std::vector< IssuerInfo >> callback) const
Get warrant issuers.
Subscription flags.
Definition: types.hpp:70
Period
Candlestick period.
Definition: types.hpp:128
AdjustType
Adjust type.
Definition: types.hpp:685
SecurityListCategory
Security list category.
Definition: types.hpp:1177
WarrantSortBy
Warrant sort by.
Definition: types.hpp:1040
SortOrderType
Sort order type.
Definition: types.hpp:1031
TradeSessions
Trade sessions.
Definition: types.hpp:1199
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:814
An request for update watchlist group.
Definition: types.hpp:823