LongPort OpenAPI C++ SDK
|
Trade context. More...
#include <trade_context.hpp>
Public Member Functions | |
TradeContext () | |
TradeContext (const lb_trade_context_t *ctx) | |
TradeContext (const TradeContext &ctx) | |
TradeContext (TradeContext &&ctx) | |
~TradeContext () | |
TradeContext & | operator= (const TradeContext &ctx) |
size_t | ref_count () const |
void | subscribe (const std::vector< TopicType > &topics, AsyncCallback< TradeContext, void > callback) const |
Subscribe. More... | |
void | unsubscribe (const std::vector< TopicType > &topics, AsyncCallback< TradeContext, void > callback) const |
Unsubscribe. More... | |
void | set_on_order_changed (PushCallback< TradeContext, PushOrderChanged > callback) const |
void | history_executions (const std::optional< GetHistoryExecutionsOptions > &opts, AsyncCallback< TradeContext, std::vector< Execution >> callback) const |
Get history executions. More... | |
void | today_executions (const std::optional< GetTodayExecutionsOptions > &opts, AsyncCallback< TradeContext, std::vector< Execution >> callback) const |
Get today executions. More... | |
void | history_orders (const std::optional< GetHistoryOrdersOptions > &opts, AsyncCallback< TradeContext, std::vector< Order >> callback) const |
Get history orders. More... | |
void | today_orders (const std::optional< GetTodayOrdersOptions > &opts, AsyncCallback< TradeContext, std::vector< Order >> callback) const |
Get history orders. More... | |
void | replace_order (const ReplaceOrderOptions &opts, AsyncCallback< TradeContext, void > callback) const |
Replace order. More... | |
void | submit_order (const SubmitOrderOptions &opts, AsyncCallback< TradeContext, SubmitOrderResponse > callback) const |
Submit order. More... | |
void | cancel_order (const std::string &order_id, AsyncCallback< TradeContext, void > callback) const |
Cancel order. More... | |
void | account_balance (const std::string ¤cy, AsyncCallback< TradeContext, std::vector< AccountBalance >> callback) const |
Get account balance with currency. More... | |
void | account_balance (AsyncCallback< TradeContext, std::vector< AccountBalance >> callback) const |
Get account balance. More... | |
void | account_balance (const GetCashFlowOptions &opts, AsyncCallback< TradeContext, std::vector< CashFlow >> callback) const |
Get cash flow. More... | |
void | fund_positions (const std::optional< GetFundPositionsOptions > &opts, AsyncCallback< TradeContext, FundPositionsResponse > callback) const |
Get fund positions. More... | |
void | stock_positions (const std::optional< GetStockPositionsOptions > &opts, AsyncCallback< TradeContext, StockPositionsResponse > callback) const |
Get stock positions. More... | |
void | margin_ratio (const std::string &symbol, AsyncCallback< TradeContext, MarginRatio > callback) const |
Get margin ratio. More... | |
void | order_detail (const std::string &order_id, AsyncCallback< TradeContext, OrderDetail > callback) const |
Get order detail. More... | |
void | estimate_max_purchase_quantity (const EstimateMaxPurchaseQuantityOptions &opts, AsyncCallback< TradeContext, EstimateMaxPurchaseQuantityResponse > callback) const |
Static Public Member Functions | |
static void | create (const Config &config, AsyncCallback< TradeContext, void > callback) |
Trade context.
longport::trade::TradeContext::TradeContext | ( | ) |
longport::trade::TradeContext::TradeContext | ( | const lb_trade_context_t * | ctx | ) |
longport::trade::TradeContext::TradeContext | ( | const TradeContext & | ctx | ) |
longport::trade::TradeContext::TradeContext | ( | TradeContext && | ctx | ) |
longport::trade::TradeContext::~TradeContext | ( | ) |
void longport::trade::TradeContext::account_balance | ( | AsyncCallback< TradeContext, std::vector< AccountBalance >> | callback | ) | const |
Get account balance.
void longport::trade::TradeContext::account_balance | ( | const GetCashFlowOptions & | opts, |
AsyncCallback< TradeContext, std::vector< CashFlow >> | callback | ||
) | const |
Get cash flow.
void longport::trade::TradeContext::account_balance | ( | const std::string & | currency, |
AsyncCallback< TradeContext, std::vector< AccountBalance >> | callback | ||
) | const |
Get account balance with currency.
void longport::trade::TradeContext::cancel_order | ( | const std::string & | order_id, |
AsyncCallback< TradeContext, void > | callback | ||
) | const |
Cancel order.
|
static |
void longport::trade::TradeContext::estimate_max_purchase_quantity | ( | const EstimateMaxPurchaseQuantityOptions & | opts, |
AsyncCallback< TradeContext, EstimateMaxPurchaseQuantityResponse > | callback | ||
) | const |
Estimating the maximum purchase quantity for Hong Kong and US stocks, warrants, and options
void longport::trade::TradeContext::fund_positions | ( | const std::optional< GetFundPositionsOptions > & | opts, |
AsyncCallback< TradeContext, FundPositionsResponse > | callback | ||
) | const |
Get fund positions.
void longport::trade::TradeContext::history_executions | ( | const std::optional< GetHistoryExecutionsOptions > & | opts, |
AsyncCallback< TradeContext, std::vector< Execution >> | callback | ||
) | const |
Get history executions.
void longport::trade::TradeContext::history_orders | ( | const std::optional< GetHistoryOrdersOptions > & | opts, |
AsyncCallback< TradeContext, std::vector< Order >> | callback | ||
) | const |
Get history orders.
void longport::trade::TradeContext::margin_ratio | ( | const std::string & | symbol, |
AsyncCallback< TradeContext, MarginRatio > | callback | ||
) | const |
Get margin ratio.
TradeContext& longport::trade::TradeContext::operator= | ( | const TradeContext & | ctx | ) |
void longport::trade::TradeContext::order_detail | ( | const std::string & | order_id, |
AsyncCallback< TradeContext, OrderDetail > | callback | ||
) | const |
Get order detail.
size_t longport::trade::TradeContext::ref_count | ( | ) | const |
void longport::trade::TradeContext::replace_order | ( | const ReplaceOrderOptions & | opts, |
AsyncCallback< TradeContext, void > | callback | ||
) | const |
Replace order.
void longport::trade::TradeContext::set_on_order_changed | ( | PushCallback< TradeContext, PushOrderChanged > | callback | ) | const |
Set order changed callback, after receiving the order changed event, it will call back to this function.
void longport::trade::TradeContext::stock_positions | ( | const std::optional< GetStockPositionsOptions > & | opts, |
AsyncCallback< TradeContext, StockPositionsResponse > | callback | ||
) | const |
Get stock positions.
void longport::trade::TradeContext::submit_order | ( | const SubmitOrderOptions & | opts, |
AsyncCallback< TradeContext, SubmitOrderResponse > | callback | ||
) | const |
Submit order.
void longport::trade::TradeContext::subscribe | ( | const std::vector< TopicType > & | topics, |
AsyncCallback< TradeContext, void > | callback | ||
) | const |
Subscribe.
void longport::trade::TradeContext::today_executions | ( | const std::optional< GetTodayExecutionsOptions > & | opts, |
AsyncCallback< TradeContext, std::vector< Execution >> | callback | ||
) | const |
Get today executions.
void longport::trade::TradeContext::today_orders | ( | const std::optional< GetTodayOrdersOptions > & | opts, |
AsyncCallback< TradeContext, std::vector< Order >> | callback | ||
) | const |
Get history orders.
void longport::trade::TradeContext::unsubscribe | ( | const std::vector< TopicType > & | topics, |
AsyncCallback< TradeContext, void > | callback | ||
) | const |
Unsubscribe.