Longbridge OpenAPI C++ SDK
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 longbridge {
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 QuoteContext create(const Config& config);
32 
35 
38 
41  AsyncCallback<QuoteContext, std::vector<QuotePackageDetail>> callback)
42  const;
43 
45  void subscribe(const std::vector<std::string>& symbols,
46  SubFlags sub_flags,
47  AsyncCallback<QuoteContext, void> callback) const;
48 
50  void unsubscribe(const std::vector<std::string>& symbols,
51  SubFlags sub_flags,
52  AsyncCallback<QuoteContext, void> callback) const;
53 
56  const std::string& symbol,
57  Period period,
58  TradeSessions trade_sessions,
59  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
60 
63  const std::string& symbol,
64  Period period,
65  AsyncCallback<QuoteContext, void> callback) const;
66 
69  AsyncCallback<QuoteContext, std::vector<Subscription>> callback) const;
70 
74 
78 
82 
86 
91 
93  void static_info(const std::vector<std::string>& symbols,
94  AsyncCallback<QuoteContext, std::vector<SecurityStaticInfo>>
95  callback) const;
96 
98  void quote(
99  const std::vector<std::string>& symbols,
100  AsyncCallback<QuoteContext, std::vector<SecurityQuote>> callback) const;
101 
104  const std::vector<std::string>& symbols,
105  AsyncCallback<QuoteContext, std::vector<OptionQuote>> callback) const;
106 
109  const std::vector<std::string>& symbols,
110  AsyncCallback<QuoteContext, std::vector<WarrantQuote>> callback) const;
111 
113  void depth(const std::string& symbol,
115 
117  void brokers(const std::string& symbol,
119 
122  AsyncCallback<QuoteContext, std::vector<ParticipantInfo>> callback) const;
123 
125  void trades(const std::string& symbol,
126  uintptr_t count,
127  AsyncCallback<QuoteContext, std::vector<Trade>> callback) const;
128 
130  void intraday(
131  const std::string& symbol,
132  TradeSessions trade_sessions,
133  AsyncCallback<QuoteContext, std::vector<IntradayLine>> callback) const;
134 
137  const std::string& symbol,
138  Period period,
139  uintptr_t count,
140  AdjustType adjust_type,
141  TradeSessions trade_sessions,
142  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
143 
146  const std::string& symbol,
147  Period period,
148  AdjustType adjust_type,
149  bool forward,
150  std::optional<DateTime> datetime,
151  uintptr_t count,
152  TradeSessions trade_sessions,
153  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
154 
157  const std::string& symbol,
158  Period period,
159  AdjustType adjust_type,
160  std::optional<Date> start,
161  std::optional<Date> end,
162  TradeSessions trade_sessions,
163  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
164 
167  const std::string& symbol,
168  AsyncCallback<QuoteContext, std::vector<Date>> callback) const;
169 
172  const std::string& symbol,
173  Date expiry_date,
174  AsyncCallback<QuoteContext, std::vector<StrikePriceInfo>> callback) const;
175 
178  AsyncCallback<QuoteContext, std::vector<IssuerInfo>> callback) const;
179 
182  const std::string& symbol,
183  WarrantSortBy sort_by,
184  SortOrderType sort_order,
185  const std::vector<WarrantType>& warrant_type,
186  const std::vector<int32_t>& issuer,
187  const std::vector<FilterWarrantExpiryDate>& expiry_date,
188  const std::vector<FilterWarrantInOutBoundsType>& price_type,
189  const std::vector<WarrantStatus>& status,
190  AsyncCallback<QuoteContext, std::vector<WarrantInfo>> callback) const;
191 
194  AsyncCallback<QuoteContext, std::vector<MarketTradingSession>> callback)
195  const;
196 
201  void trading_days(Market market,
202  Date begin,
203  Date end,
205 
208  const std::string& symbol,
209  AsyncCallback<QuoteContext, std::vector<CapitalFlowLine>> callback) const;
210 
213  const std::string& symbol,
215 
218  const std::vector<std::string>& symbols,
219  const std::vector<CalcIndex>& indexes,
220  AsyncCallback<QuoteContext, std::vector<SecurityCalcIndex>> callback) const;
221 
223  void watchlist(
224  AsyncCallback<QuoteContext, std::vector<WatchlistGroup>> callback) const;
225 
228  const CreateWatchlistGroup& req,
229  AsyncCallback<QuoteContext, int64_t> callback) const;
230 
232  void delete_watchlist_group(int64_t id,
233  bool purge,
234  AsyncCallback<QuoteContext, void> callback) const;
235 
238  AsyncCallback<QuoteContext, void> callback) const;
239 
241  void filings(const std::string& symbol,
242  AsyncCallback<QuoteContext, std::vector<FilingItem>> callback)
243  const;
244 
247  Market market,
248  SecurityListCategory category,
249  AsyncCallback<QuoteContext, std::vector<Security>> callback) const;
250 
253  Market market,
254  AsyncCallback<QuoteContext, std::vector<Security>> callback) const;
255 
258  Market market,
260 
263  Market market,
264  Date start,
265  Date end,
267  const;
268 
274  const std::vector<std::string>& symbols,
275  AsyncCallback<QuoteContext, std::vector<RealtimeQuote>> callback) const;
276 
282  const std::string& symbol,
284 
290  const std::string& symbol,
291  uint64_t count,
292  AsyncCallback<QuoteContext, std::vector<Trade>> callback) const;
293 
299  const std::string& symbol,
301 
307  const std::string& symbol,
308  Period period,
309  uintptr_t count,
310  AsyncCallback<QuoteContext, std::vector<Candlestick>> callback) const;
311 };
312 
313 } // namespace quote
314 } // namespace longbridge
Definition: config.hpp:16
Quote context.
Definition: quote_context.hpp:16
static QuoteContext create(const Config &config)
void delete_watchlist_group(int64_t id, bool purge, AsyncCallback< QuoteContext, void > callback) const
Delete watchlist group.
void realtime_candlesticks(const std::string &symbol, Period period, uintptr_t count, AsyncCallback< QuoteContext, std::vector< Candlestick >> 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_quote(const std::vector< std::string > &symbols, AsyncCallback< QuoteContext, std::vector< RealtimeQuote >> callback) const
void market_temperature(Market market, AsyncCallback< QuoteContext, MarketTemperature > callback) const
Get current market temperature.
void member_id(AsyncCallback< QuoteContext, int64_t > callback) const
Returns the member id.
void subscribe(const std::vector< std::string > &symbols, SubFlags sub_flags, AsyncCallback< QuoteContext, void > callback) const
Subscribe.
void calc_indexes(const std::vector< std::string > &symbols, const std::vector< CalcIndex > &indexes, AsyncCallback< QuoteContext, std::vector< SecurityCalcIndex >> callback) const
Get calc indexes.
void option_chain_expiry_date_list(const std::string &symbol, AsyncCallback< QuoteContext, std::vector< Date >> callback) const
Get option chain expiry date list.
void capital_flow(const std::string &symbol, AsyncCallback< QuoteContext, std::vector< CapitalFlowLine >> callback) const
Get capital flow intraday.
void set_on_trades(PushCallback< QuoteContext, PushTrades > callback) const
void realtime_depth(const std::string &symbol, AsyncCallback< QuoteContext, SecurityDepth > callback) const
void participants(AsyncCallback< QuoteContext, std::vector< ParticipantInfo >> callback) const
Get participants.
void trades(const std::string &symbol, uintptr_t count, AsyncCallback< QuoteContext, std::vector< Trade >> callback) const
Get security trades.
void capital_distribution(const std::string &symbol, AsyncCallback< QuoteContext, CapitalDistributionResponse > callback) const
Get capital distribution.
void watchlist(AsyncCallback< QuoteContext, std::vector< WatchlistGroup >> callback) const
Get watchlist.
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 realtime_brokers(const std::string &symbol, AsyncCallback< QuoteContext, SecurityBrokers > callback) const
void filings(const std::string &symbol, AsyncCallback< QuoteContext, std::vector< FilingItem >> callback) const
Get filings.
void trading_days(Market market, Date begin, Date end, AsyncCallback< QuoteContext, MarketTradingDays > callback)
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 subscribe_candlesticks(const std::string &symbol, Period period, TradeSessions trade_sessions, AsyncCallback< QuoteContext, std::vector< Candlestick >> callback) const
Subscribe security candlesticks.
void warrant_issuers(AsyncCallback< QuoteContext, std::vector< IssuerInfo >> callback) const
Get warrant issuers.
void depth(const std::string &symbol, AsyncCallback< QuoteContext, SecurityDepth > callback) const
Get security depth.
void set_on_depth(PushCallback< QuoteContext, PushDepth > callback) const
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 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 security_list(Market market, SecurityListCategory category, AsyncCallback< QuoteContext, std::vector< Security >> callback) const
Get security list.
void quote_level(AsyncCallback< QuoteContext, std::string > callback) const
Returns the quote level.
void history_market_temperature(Market market, Date start, Date end, AsyncCallback< QuoteContext, HistoryMarketTemperatureResponse > callback) const
Get historical market temperature.
void quote(const std::vector< std::string > &symbols, AsyncCallback< QuoteContext, std::vector< SecurityQuote >> callback) const
Get quote of securities.
void static_info(const std::vector< std::string > &symbols, AsyncCallback< QuoteContext, std::vector< SecurityStaticInfo >> callback) const
Get basic information of securities.
void realtime_trades(const std::string &symbol, uint64_t count, AsyncCallback< QuoteContext, std::vector< Trade >> callback) const
void trading_session(AsyncCallback< QuoteContext, std::vector< MarketTradingSession >> callback) const
Get trading session of the day.
void security_list(Market market, AsyncCallback< QuoteContext, std::vector< Security >> callback) const
Get security list without category.
QuoteContext(const lb_quote_context_t *ctx)
void update_watchlist_group(const UpdateWatchlistGroup &req, AsyncCallback< QuoteContext, void > callback) const
Create watchlist group.
QuoteContext(const QuoteContext &ctx)
QuoteContext & operator=(const QuoteContext &ctx)
QuoteContext(QuoteContext &&ctx)
void intraday(const std::string &symbol, TradeSessions trade_sessions, 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 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 warrant_quote(const std::vector< std::string > &symbols, AsyncCallback< QuoteContext, std::vector< WarrantQuote >> callback) const
Get quote of warrant securities.
void unsubscribe(const std::vector< std::string > &symbols, SubFlags sub_flags, AsyncCallback< QuoteContext, void > callback) const
Unsubscribe.
void subscriptions(AsyncCallback< QuoteContext, std::vector< Subscription >> callback) const
Get subscription information.
void set_on_quote(PushCallback< QuoteContext, PushQuote > callback) const
void set_on_brokers(PushCallback< QuoteContext, PushBrokers > callback) const
void brokers(const std::string &symbol, AsyncCallback< QuoteContext, SecurityBrokers > callback) const
Get security brokers.
void quote_package_details(AsyncCallback< QuoteContext, std::vector< QuotePackageDetail >> callback) const
Returns the quote package details.
void create_watchlist_group(const CreateWatchlistGroup &req, AsyncCallback< QuoteContext, int64_t > callback) const
Create watchlist group.
Subscription flags.
Definition: types.hpp:72
WarrantSortBy
Warrant sort by.
Definition: types.hpp:1046
TradeSessions
Trade sessions.
Definition: types.hpp:1205
Period
Candlestick period.
Definition: types.hpp:130
AdjustType
Adjust type.
Definition: types.hpp:691
SecurityListCategory
Security list category.
Definition: types.hpp:1183
SortOrderType
Sort order type.
Definition: types.hpp:1037
Definition: async_result.hpp:8
std::function< void(PushEvent< Ctx, T >)> PushCallback
Definition: push.hpp:27
std::function< void(AsyncResult< Ctx, T >)> AsyncCallback
Definition: async_result.hpp:48
Market
Market.
Definition: types.hpp:51
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:820
An request for update watchlist group.
Definition: types.hpp:829