![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
An order's type, price, trigger, time in force and session, as an amendment states them. More...
#include <algotradelib/src/core/types.hpp>
Public Member Functions | |
| OrderShape ()=default | |
| Constructs a limit shape with nothing else stated. | |
| OrderShape (OrderType type, std::optional< Decimal64 > price, std::optional< TimeInForce > time_in_force=std::nullopt, std::optional< OrderSession > session=std::nullopt, std::optional< Decimal64 > trigger_price=std::nullopt) | |
| Constructs a shape, stating only what the caller means to set. | |
Public Attributes | |
| OrderType | type_ {OrderType::LIMIT} |
| The price basis. | |
| std::optional< Decimal64 > | price_ |
| The price, for a basis that takes one. | |
| std::optional< Decimal64 > | trigger_price_ |
| The trigger price, for STOP_LIMIT. | |
| std::optional< TimeInForce > | time_in_force_ |
| The time in force; unset means "keep the resting order's". | |
| std::optional< OrderSession > | session_ |
| The session; unset means "keep the resting order's". | |
An order's type, price, trigger, time in force and session, as an amendment states them.
In an amendment, an unset time in force or session keeps the order's own. An unset trigger keeps the resting trigger only when both the new and the resting type are STOP_LIMIT; turning a stop into a plain LIMIT drops its trigger. To change only the price, use reprice.
|
inline |
Constructs a shape, stating only what the caller means to set.
| type | The price basis. |
| price | The price, for a basis that takes one. |
| time_in_force | The time in force, or unset to keep the resting order's. |
| session | The session, or unset to keep the resting order's. |
| trigger_price | The trigger; unset keeps a resting stop's trigger only if type is also STOP_LIMIT. |
| std::optional<Decimal64> algotradelib::OrderShape::price_ |
The price, for a basis that takes one.
Definition at line 2207 of file types.hpp.
Referenced by algotradelib::cancel_all(), algotradelib::cancel_quantity(), OrderShape(), and algotradelib::resting_shape().
| std::optional<OrderSession> algotradelib::OrderShape::session_ |
The session; unset means "keep the resting order's".
A set value is a deliberate change: made where the broker can make it, refused where it cannot (Toss cannot move an order between sessions).
Definition at line 2230 of file types.hpp.
Referenced by algotradelib::cancel_all(), algotradelib::cancel_quantity(), OrderShape(), and algotradelib::resting_shape().
| std::optional<TimeInForce> algotradelib::OrderShape::time_in_force_ |
The time in force; unset means "keep the resting order's".
A set value is a deliberate change: made where the broker can make it, refused where it cannot (Toss cannot change it on a modify).
Definition at line 2223 of file types.hpp.
Referenced by algotradelib::cancel_all(), algotradelib::cancel_quantity(), OrderShape(), and algotradelib::resting_shape().
| std::optional<Decimal64> algotradelib::OrderShape::trigger_price_ |
The trigger price, for STOP_LIMIT.
On an amendment, unset keeps the resting stop's trigger, but only when both the new and the resting shape are STOP_LIMIT (see amended_trigger_price); changing into a stop needs a trigger stated. A trigger set on a type that takes none is refused. On an OrderRequest, a stop-limit without one is refused.
Definition at line 2216 of file types.hpp.
Referenced by algotradelib::amended_trigger_price(), algotradelib::cancel_all(), algotradelib::cancel_quantity(), OrderShape(), and algotradelib::resting_shape().
| OrderType algotradelib::OrderShape::type_ {OrderType::LIMIT} |
The price basis.
Definition at line 2205 of file types.hpp.
Referenced by algotradelib::amended_trigger_price(), algotradelib::cancel_all(), algotradelib::cancel_quantity(), OrderShape(), and algotradelib::resting_shape().