|
Longbridge OpenAPI C++ SDK
|
#include <types.hpp>
Public Member Functions | |
| GridTradeRule & | with_limit_events (GridLimitEvent upper, GridLimitEvent lower) |
| Set the actions taken at the upper / lower bounds. More... | |
| GridTradeRule & | with_depths (int32_t sell, int32_t buy) |
Set the sell / buy order-book depths (0 = use the order type). More... | |
| GridTradeRule & | with_order_types (std::string up, std::string down) |
Set the sell / buy order types (GMO / GLO / GTG). More... | |
| GridTradeRule & | with_multiple_trigger (bool value) |
| Allow a single grid level to trigger multiple times. More... | |
| GridTradeRule & | with_support_shortsell (bool value) |
| Allow short selling. More... | |
| GridTradeRule & | with_rth (int32_t value) |
Set the regular-trading-hours flag (0 / 1 / 2). More... | |
| GridTradeRule & | with_expire_time (int64_t unix_seconds) |
| Set the expiry time (unix seconds), used with a GTD time-in-force. More... | |
Static Public Member Functions | |
| static GridTradeRule | create (Decimal base_price, Decimal upper_price, Decimal lower_price, GridTrigger trigger, Decimal quantity, Decimal upper_quantity, Decimal lower_quantity, GridTimeInForce time_in_force) |
Public Attributes | |
| std::optional< Decimal > | submitted_base_price |
| Base price the grid is anchored to. More... | |
| std::optional< Decimal > | upper_limit_price |
| Upper price bound. More... | |
| std::optional< Decimal > | lower_limit_price |
| Lower price bound. More... | |
| std::optional< TriggerPriceType > | trigger_price_type |
Trigger price type (only Spread / Percent allowed) More... | |
| std::optional< Decimal > | trigger_spread_up |
| Upward trigger spread (absolute) More... | |
| std::optional< Decimal > | trigger_spread_down |
| Downward trigger spread (absolute) More... | |
| std::optional< Decimal > | trigger_percent_up |
| Upward trigger percent. More... | |
| std::optional< Decimal > | trigger_percent_down |
| Downward trigger percent. More... | |
| std::optional< bool > | multiple_trigger |
| Whether a single grid level may trigger multiple times. More... | |
| std::optional< GridTimeInForce > | time_in_force |
Time in force (Day / GoodTilCanceled / GoodTilDate) More... | |
| std::optional< Decimal > | upper_limit_quantity |
| Quantity handled when the upper bound is reached. More... | |
| std::optional< Decimal > | lower_limit_quantity |
| Quantity handled when the lower bound is reached. More... | |
| std::optional< int64_t > | expire_time |
| Expiry time (unix seconds), used with GTD. More... | |
| std::optional< GridLimitEvent > | upper_limit_event |
| std::optional< GridLimitEvent > | lower_limit_event |
| std::optional< int32_t > | trigger_sell_depth |
Sell-side order-book depth (-5..5, 0 = use grid_order_type_up) More... | |
| std::optional< int32_t > | trigger_buy_depth |
Buy-side order-book depth (-5..5, 0 = use grid_order_type_down) More... | |
| std::optional< Decimal > | trigger_quantity |
| Quantity per trigger. More... | |
| std::optional< bool > | support_shortsell |
| Whether short selling is allowed. More... | |
| std::optional< int32_t > | rth |
Regular trading hours flag (0 / 1 / 2) More... | |
| std::optional< std::string > | grid_order_type_up |
Sell-side order type when depth is 0 (GMO / GLO / GTG) More... | |
| std::optional< std::string > | grid_order_type_down |
Buy-side order type when depth is 0 (GMO / GLO / GTG) More... | |
Grid trading rule — parameters for submit / replace.
All fields are public and optional; use GridTradeRule::create to build a rule with the minimum required field set visible in the signature, then the fluent with_* setters for optional parameters.
|
inlinestatic |
Create a rule with the fields a valid grid order requires. The gateway still validates business rules, but this makes the minimum field set visible in the signature instead of leaving all fields optional.
|
inline |
Set the sell / buy order-book depths (0 = use the order type).
|
inline |
Set the expiry time (unix seconds), used with a GTD time-in-force.
|
inline |
Set the actions taken at the upper / lower bounds.
|
inline |
Allow a single grid level to trigger multiple times.
|
inline |
Set the sell / buy order types (GMO / GLO / GTG).
|
inline |
Set the regular-trading-hours flag (0 / 1 / 2).
|
inline |
Allow short selling.
| std::optional<int64_t> longbridge::grid::GridTradeRule::expire_time |
Expiry time (unix seconds), used with GTD.
| std::optional<std::string> longbridge::grid::GridTradeRule::grid_order_type_down |
Buy-side order type when depth is 0 (GMO / GLO / GTG)
| std::optional<std::string> longbridge::grid::GridTradeRule::grid_order_type_up |
Sell-side order type when depth is 0 (GMO / GLO / GTG)
| std::optional<GridLimitEvent> longbridge::grid::GridTradeRule::lower_limit_event |
Action when the lower bound is reached (only Ignore / CloseAtLast allowed)
| std::optional<Decimal> longbridge::grid::GridTradeRule::lower_limit_price |
Lower price bound.
| std::optional<Decimal> longbridge::grid::GridTradeRule::lower_limit_quantity |
Quantity handled when the lower bound is reached.
| std::optional<bool> longbridge::grid::GridTradeRule::multiple_trigger |
Whether a single grid level may trigger multiple times.
| std::optional<int32_t> longbridge::grid::GridTradeRule::rth |
Regular trading hours flag (0 / 1 / 2)
| std::optional<Decimal> longbridge::grid::GridTradeRule::submitted_base_price |
Base price the grid is anchored to.
| std::optional<bool> longbridge::grid::GridTradeRule::support_shortsell |
Whether short selling is allowed.
| std::optional<GridTimeInForce> longbridge::grid::GridTradeRule::time_in_force |
Time in force (Day / GoodTilCanceled / GoodTilDate)
| std::optional<int32_t> longbridge::grid::GridTradeRule::trigger_buy_depth |
Buy-side order-book depth (-5..5, 0 = use grid_order_type_down)
| std::optional<Decimal> longbridge::grid::GridTradeRule::trigger_percent_down |
Downward trigger percent.
| std::optional<Decimal> longbridge::grid::GridTradeRule::trigger_percent_up |
Upward trigger percent.
| std::optional<TriggerPriceType> longbridge::grid::GridTradeRule::trigger_price_type |
Trigger price type (only Spread / Percent allowed)
| std::optional<Decimal> longbridge::grid::GridTradeRule::trigger_quantity |
Quantity per trigger.
| std::optional<int32_t> longbridge::grid::GridTradeRule::trigger_sell_depth |
Sell-side order-book depth (-5..5, 0 = use grid_order_type_up)
| std::optional<Decimal> longbridge::grid::GridTradeRule::trigger_spread_down |
Downward trigger spread (absolute)
| std::optional<Decimal> longbridge::grid::GridTradeRule::trigger_spread_up |
Upward trigger spread (absolute)
| std::optional<GridLimitEvent> longbridge::grid::GridTradeRule::upper_limit_event |
Action when the upper bound is reached (only Ignore / CloseAtLast allowed)
| std::optional<Decimal> longbridge::grid::GridTradeRule::upper_limit_price |
Upper price bound.
| std::optional<Decimal> longbridge::grid::GridTradeRule::upper_limit_quantity |
Quantity handled when the upper bound is reached.