|
Longbridge OpenAPI C++ SDK
|
Trade context. More...
#include <trade_context.hpp>
Static Public Member Functions | |
| static TradeContext | create (const Config &config) |
Trade context.
| longbridge::trade::TradeContext::TradeContext | ( | ) |
| longbridge::trade::TradeContext::TradeContext | ( | const lb_trade_context_t * | ctx | ) |
| longbridge::trade::TradeContext::TradeContext | ( | const TradeContext & | ctx | ) |
| longbridge::trade::TradeContext::TradeContext | ( | TradeContext && | ctx | ) |
| longbridge::trade::TradeContext::~TradeContext | ( | ) |
| void longbridge::trade::TradeContext::account_balance | ( | AsyncCallback< TradeContext, std::vector< AccountBalance >> | callback | ) | const |
Get account balance
AP accounts only: US data-center accounts get a region error.
| void longbridge::trade::TradeContext::account_balance | ( | const GetCashFlowOptions & | opts, |
| AsyncCallback< TradeContext, std::vector< CashFlow >> | callback | ||
| ) | const |
Get cash flow
AP accounts only: US data-center accounts get a region error.
| void longbridge::trade::TradeContext::account_balance | ( | const std::string & | currency, |
| AsyncCallback< TradeContext, std::vector< AccountBalance >> | callback | ||
| ) | const |
Get account balance with currency
AP accounts only: US data-center accounts get a region error.
| void longbridge::trade::TradeContext::all_executions | ( | const std::optional< GetAllExecutionsOptions > & | opts, |
| AsyncCallback< TradeContext, AllExecutionsResponse > | callback | ||
| ) | const |
Get all executions
AP accounts only: US data-center accounts get a region error; use history_executions instead.
| void longbridge::trade::TradeContext::cancel_order | ( | const std::string & | order_id, |
| AsyncCallback< TradeContext, void > | callback, | ||
| bool | is_attached = false |
||
| ) | const |
Cancel order.
|
static |
| void longbridge::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 longbridge::trade::TradeContext::fund_positions | ( | const std::optional< GetFundPositionsOptions > & | opts, |
| AsyncCallback< TradeContext, FundPositionsResponse > | callback | ||
| ) | const |
Get fund positions
AP accounts only: US data-center accounts have no fund holdings and get a region error. No US equivalent.
| void longbridge::trade::TradeContext::history_executions | ( | const std::optional< GetHistoryExecutionsOptions > & | opts, |
| AsyncCallback< TradeContext, std::vector< Execution >> | callback | ||
| ) | const |
Get history executions
side may be Unknown on Longbridge US accounts.
| void longbridge::trade::TradeContext::history_orders | ( | const std::optional< GetHistoryOrdersOptions > & | opts, |
| AsyncCallback< TradeContext, std::vector< Order >> | callback | ||
| ) | const |
Get history orders.
| void longbridge::trade::TradeContext::margin_ratio | ( | const std::string & | symbol, |
| AsyncCallback< TradeContext, MarginRatio > | callback | ||
| ) | const |
Get margin ratio
AP accounts only: US data-center accounts get a region error. No US equivalent.
| TradeContext& longbridge::trade::TradeContext::operator= | ( | const TradeContext & | ctx | ) |
| void longbridge::trade::TradeContext::order_detail | ( | const std::string & | order_id, |
| AsyncCallback< TradeContext, OrderDetail > | callback | ||
| ) | const |
Get order detail
AP accounts only: US data-center accounts get a region error.
| void longbridge::trade::TradeContext::order_detail_attached | ( | const std::string & | order_id, |
| AsyncCallback< TradeContext, OrderDetail > | callback | ||
| ) | const |
Get order detail with attached orders.
| size_t longbridge::trade::TradeContext::ref_count | ( | ) | const |
| void longbridge::trade::TradeContext::replace_order | ( | const ReplaceOrderOptions & | opts, |
| AsyncCallback< TradeContext, void > | callback | ||
| ) | const |
Replace order.
| void longbridge::trade::TradeContext::set_on_grid_order_changed | ( | PushCallback< TradeContext, PushGridOrderChanged > | callback | ) | const |
Set grid order changed callback, after receiving the grid order changed event, it will call back to this function.
| void longbridge::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 longbridge::trade::TradeContext::stock_positions | ( | const std::optional< GetStockPositionsOptions > & | opts, |
| AsyncCallback< TradeContext, StockPositionsResponse > | callback | ||
| ) | const |
Get stock positions
AP accounts only: US data-center accounts get a region error.
| void longbridge::trade::TradeContext::submit_multileg | ( | const SubmitMultiLegOrderOptions & | opts, |
| AsyncCallback< TradeContext, SubmitOrderResponse > | callback | ||
| ) | const |
Submit a multi-leg option combination order (such as vertical spreads, straddles, strangles, collars, etc.). All legs are submitted together as a single strategy order.
| void longbridge::trade::TradeContext::submit_order | ( | const SubmitOrderOptions & | opts, |
| AsyncCallback< TradeContext, SubmitOrderResponse > | callback | ||
| ) | const |
Submit order.
| void longbridge::trade::TradeContext::subscribe | ( | const std::vector< TopicType > & | topics, |
| AsyncCallback< TradeContext, void > | callback | ||
| ) | const |
Subscribe.
| void longbridge::trade::TradeContext::today_executions | ( | const std::optional< GetTodayExecutionsOptions > & | opts, |
| AsyncCallback< TradeContext, std::vector< Execution >> | callback | ||
| ) | const |
Get today executions.
| void longbridge::trade::TradeContext::today_orders | ( | const std::optional< GetTodayOrdersOptions > & | opts, |
| AsyncCallback< TradeContext, std::vector< Order >> | callback | ||
| ) | const |
Get history orders.
| void longbridge::trade::TradeContext::unsubscribe | ( | const std::vector< TopicType > & | topics, |
| AsyncCallback< TradeContext, void > | callback | ||
| ) | const |
Unsubscribe.