![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
Donchian channel breakout: holds after the close breaks above the channel, exits after it breaks below. 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. | |
Donchian channel breakout: holds after the close breaks above the channel, exits after it breaks below.
The channel is the highest and lowest close of the lookback_ bars before the latest one. A close above the channel states a target of quantity_; a close below it, a target of zero.
Definition at line 206 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 235 of file reversion.hpp.
|
inline |
Returns how many bars to load before the first live bar.
Definition at line 226 of file reversion.hpp.
| Params algotradelib::strategy::vanilla::DonchianBreakout::params_ |
The settings.
Definition at line 220 of file reversion.hpp.
Referenced by on_bar(), and warmup_bars().