algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::strategy::vanilla::MovingAverageCrossover::Params Struct Reference

The strategy's settings. More...

#include <algotradelib/src/strategy/vanilla/crossover.hpp>

Collaboration diagram for algotradelib::strategy::vanilla::MovingAverageCrossover::Params:

Public Attributes

InstrumentId instrument_
 The instrument to trade; bars for any other instrument are ignored.
std::size_t fast_ {20}
 The fast span; must be nonzero and less than slow_, or the strategy does nothing.
std::size_t slow_ {50}
 The slow span.
AverageKind kind_ {AverageKind::SIMPLE}
 Which average to use; see AverageKind.
Decimal64 quantity_
 The shares to hold while the fast average is above the slow one.
std::string tag_ {"ma-crossover"}
 The tag on the targets.

Detailed Description

The strategy's settings.

Definition at line 49 of file crossover.hpp.

Member Data Documentation

◆ fast_

std::size_t algotradelib::strategy::vanilla::MovingAverageCrossover::Params::fast_ {20}

The fast span; must be nonzero and less than slow_, or the strategy does nothing.

Definition at line 53 of file crossover.hpp.

Referenced by algotradelib::strategy::vanilla::MovingAverageCrossover::on_bar().

◆ instrument_

InstrumentId algotradelib::strategy::vanilla::MovingAverageCrossover::Params::instrument_

The instrument to trade; bars for any other instrument are ignored.

Definition at line 51 of file crossover.hpp.

Referenced by algotradelib::strategy::vanilla::MovingAverageCrossover::on_bar().

◆ kind_

AverageKind algotradelib::strategy::vanilla::MovingAverageCrossover::Params::kind_ {AverageKind::SIMPLE}

Which average to use; see AverageKind.

Definition at line 57 of file crossover.hpp.

◆ quantity_

Decimal64 algotradelib::strategy::vanilla::MovingAverageCrossover::Params::quantity_

The shares to hold while the fast average is above the slow one.

Definition at line 59 of file crossover.hpp.

Referenced by algotradelib::strategy::vanilla::MovingAverageCrossover::on_bar().

◆ slow_

std::size_t algotradelib::strategy::vanilla::MovingAverageCrossover::Params::slow_ {50}

◆ tag_

std::string algotradelib::strategy::vanilla::MovingAverageCrossover::Params::tag_ {"ma-crossover"}

The tag on the targets.

Definition at line 61 of file crossover.hpp.

Referenced by algotradelib::strategy::vanilla::MovingAverageCrossover::on_bar().


The documentation for this struct was generated from the following file: