Longbridge OpenAPI C++ SDK
market_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 "types.hpp"
7 
9 
10 namespace longbridge {
11 namespace market {
12 
14 {
15  Rct1 = 0,
16  Rct5 = 1,
17  Rct20 = 2,
18  Rct60 = 3,
19 };
20 enum class AhPremiumPeriod
21 {
22  Min1 = 0,
23  Min5 = 1,
24  Min15 = 2,
25  Min30 = 3,
26  Min60 = 4,
27  Day = 5,
28  Week = 6,
29  Month = 7,
30  Year = 8,
31 };
32 
35 {
36 private:
37  const lb_market_context_t* ctx_;
38 
39 public:
46 
47  static MarketContext create(const Config& config);
48 
51 
53  void broker_holding(const std::string& symbol, BrokerHoldingPeriod period,
55 
57  void broker_holding_detail(const std::string& symbol,
59 
61  void broker_holding_daily(const std::string& symbol, const std::string& broker_id,
63 
65  void ah_premium(const std::string& symbol, AhPremiumPeriod period, uint32_t count,
67 
69  void ah_premium_intraday(const std::string& symbol,
71 
73  void trade_stats(const std::string& symbol,
75 
77  void anomaly(const std::string& market,
79 
81  void constituent(const std::string& symbol,
83 };
84 
85 } // namespace market
86 } // namespace longbridge
Definition: config.hpp:16
Market data context.
Definition: market_context.hpp:35
MarketContext(const lb_market_context_t *ctx)
void trade_stats(const std::string &symbol, AsyncCallback< MarketContext, TradeStatsResponse > callback) const
Get trade statistics.
void ah_premium_intraday(const std::string &symbol, AsyncCallback< MarketContext, AhPremiumIntraday > callback) const
Get A/H premium intraday.
void constituent(const std::string &symbol, AsyncCallback< MarketContext, IndexConstituents > callback) const
Get index constituents.
void broker_holding(const std::string &symbol, BrokerHoldingPeriod period, AsyncCallback< MarketContext, BrokerHoldingTop > callback) const
Get top broker holdings.
void broker_holding_detail(const std::string &symbol, AsyncCallback< MarketContext, BrokerHoldingDetail > callback) const
Get full broker holding details.
static MarketContext create(const Config &config)
MarketContext & operator=(const MarketContext &ctx)
MarketContext(MarketContext &&ctx)
MarketContext(const MarketContext &ctx)
void anomaly(const std::string &market, AsyncCallback< MarketContext, AnomalyResponse > callback) const
Get market anomalies.
void market_status(AsyncCallback< MarketContext, MarketStatusResponse > callback) const
Get market trading status.
void ah_premium(const std::string &symbol, AhPremiumPeriod period, uint32_t count, AsyncCallback< MarketContext, AhPremiumKlines > callback) const
Get A/H premium K-lines.
void broker_holding_daily(const std::string &symbol, const std::string &broker_id, AsyncCallback< MarketContext, BrokerHoldingDailyHistory > callback) const
Get daily broker holding history.
struct lb_market_context_t lb_market_context_t
Definition: market_context.hpp:8
AhPremiumPeriod
Definition: market_context.hpp:21
BrokerHoldingPeriod
Definition: market_context.hpp:14
Definition: alert_context.hpp:9
std::function< void(AsyncResult< Ctx, T >)> AsyncCallback
Definition: async_result.hpp:48