![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
Flattens every position when the market enters a phase it should not hold through. More...
#include <algotradelib/src/strategy/vanilla/timed_liquidation.hpp>
Classes | |
| struct | Params |
| The strategy's settings. More... | |
Public Member Functions | |
| template<class Ctx> | |
| void | on_phase (Ctx &ctx, MarketPhase phase) |
| Targets zero in every held instrument if phase is not in hold_through_. | |
Public Attributes | |
| Params | params_ |
| The settings. | |
Static Public Attributes | |
| static constexpr std::size_t | warmup_bars = 0 |
| No history is needed. | |
Flattens every position when the market enters a phase it should not hold through.
On each phase change that is not in hold_through_ (including UNKNOWN, an uncovered calendar date), it states a target of zero for every instrument held. Working orders against those targets are cancelled by reconciliation.
Definition at line 28 of file timed_liquidation.hpp.
|
inline |
Targets zero in every held instrument if phase is not in hold_through_.
| Ctx | The runner's context type. |
| ctx | The context. |
| phase | The new market phase. |
Definition at line 50 of file timed_liquidation.hpp.
| Params algotradelib::strategy::vanilla::TimedLiquidation::params_ |
The settings.
Definition at line 38 of file timed_liquidation.hpp.
|
staticconstexpr |
No history is needed.
Definition at line 41 of file timed_liquidation.hpp.