![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
Long-only mean reversion on the z-score of the close. More...
#include <algotradelib/src/strategy/vanilla/reversion.hpp>
Classes | |
| struct | Params |
| The strategy's settings. More... | |
Public Member Functions | |
| std::size_t | warmup_bars () const |
| Returns how many bars to load before the first live bar. | |
| template<class Ctx> | |
| void | on_bar (Ctx &ctx, const BarEvent &bar) |
| States a target position for the instrument when its signal enters or exits. | |
Public Attributes | |
| Params | params_ |
| The settings. | |
Long-only mean reversion on the z-score of the close.
Buys quantity_ when flat and the z-score over window_ closes is at or below -entry_; goes flat when holding and the z-score has risen to -exit_ or above. Exiting before the mean (exit_ > 0) keeps it from re-entering on the next small dip.
Definition at line 25 of file reversion.hpp.
|
inline |
States a target position for the instrument when its signal enters or exits.
| Ctx | The runner's context type. |
| ctx | The context. |
| bar | The new bar. |
Definition at line 58 of file reversion.hpp.
|
inline |
Returns how many bars to load before the first live bar.
Definition at line 49 of file reversion.hpp.
| Params algotradelib::strategy::vanilla::ZScoreReversion::params_ |
The settings.
Definition at line 43 of file reversion.hpp.
Referenced by on_bar(), and warmup_bars().