![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
The position a strategy wants to hold in one instrument. More...
#include <algotradelib/src/strategy/intent.hpp>
Public Attributes | |
| InstrumentId | instrument_ |
| The instrument. | |
| Decimal64 | target_quantity_ |
| The position to hold, signed: negative is short, and zero means flat. | |
| std::optional< Price > | limit_ |
| The limit price for the orders the runner places; without one they are market orders. | |
| std::string | tag_ |
| A label carried to the orders and their fills. | |
The position a strategy wants to hold in one instrument.
The runner compares the target with the current position and the orders still working, and places only what is needed to reach it. Prefer it to OrderIntent: emitting "buy 100" again after 40 filled and 60 are working would buy 100 more, while a target of 100 buys nothing more. Submit it with ctx.submit(target).
Definition at line 442 of file intent.hpp.
| InstrumentId algotradelib::strategy::TargetPosition::instrument_ |
The instrument.
Definition at line 444 of file intent.hpp.
Referenced by algotradelib::strategy::vanilla::BuyAndHold::on_bar(), algotradelib::strategy::vanilla::DonchianBreakout::on_bar(), algotradelib::strategy::vanilla::MovingAverageCrossover::on_bar(), algotradelib::strategy::vanilla::RsiThreshold::on_bar(), algotradelib::strategy::vanilla::VolatilityTargetSizing::on_bar(), algotradelib::strategy::vanilla::ZScoreReversion::on_bar(), algotradelib::strategy::reconcile(), and algotradelib::strategy::weight_target().
| std::optional<Price> algotradelib::strategy::TargetPosition::limit_ |
The limit price for the orders the runner places; without one they are market orders.
Definition at line 448 of file intent.hpp.
Referenced by algotradelib::strategy::reconcile(), and algotradelib::strategy::weight_target().
| std::string algotradelib::strategy::TargetPosition::tag_ |
A label carried to the orders and their fills.
Definition at line 450 of file intent.hpp.
Referenced by algotradelib::strategy::vanilla::BuyAndHold::on_bar(), algotradelib::strategy::vanilla::DonchianBreakout::on_bar(), algotradelib::strategy::vanilla::MovingAverageCrossover::on_bar(), algotradelib::strategy::vanilla::RsiThreshold::on_bar(), algotradelib::strategy::vanilla::VolatilityTargetSizing::on_bar(), algotradelib::strategy::vanilla::ZScoreReversion::on_bar(), algotradelib::strategy::reconcile(), and algotradelib::strategy::weight_target().
| Decimal64 algotradelib::strategy::TargetPosition::target_quantity_ |
The position to hold, signed: negative is short, and zero means flat.
Definition at line 446 of file intent.hpp.
Referenced by algotradelib::strategy::vanilla::BuyAndHold::on_bar(), algotradelib::strategy::vanilla::DonchianBreakout::on_bar(), algotradelib::strategy::vanilla::MovingAverageCrossover::on_bar(), algotradelib::strategy::vanilla::RsiThreshold::on_bar(), algotradelib::strategy::vanilla::VolatilityTargetSizing::on_bar(), algotradelib::strategy::vanilla::ZScoreReversion::on_bar(), algotradelib::strategy::reconcile(), and algotradelib::strategy::weight_target().