tzutrader
A composable C++ backtesting library for trading strategies (experimental)
Loading...
Searching...
No Matches
tzu::BasicRunner< Portfolio, Strat, Streamer > Class Template Reference

#include <runners.h>

Inheritance diagram for tzu::BasicRunner< Portfolio, Strat, Streamer >:
tzu::Runner< BasicRunner< Portfolio, Strat, Streamer > >

Public Member Functions

 BasicRunner (Portfolio &portfolio, Strat &strat, Streamer &streamer)
void run (bool verbose=false)
Public Member Functions inherited from tzu::Runner< BasicRunner< Portfolio, Strat, Streamer > >
void run ()

Detailed Description

template<typename Portfolio, typename Strat, typename Streamer>
class tzu::BasicRunner< Portfolio, Strat, Streamer >

BasicRunner takes a strategy, a portfolio and a streamer as template parameters, and allows the user to initialize them with custom parameters. The strategy is responsible for generating trading signals based on the data provided by the streamer, while the portfolio updates its state based on the signals generated by the strategy. The streamer is responsible for providing the data to the strategy. The runner iterates through the data provided by the streamer, updates the strategy with each data point, and updates the portfolio based on the signals generated by the strategy. The runner can also print the portfolio state after each update if the verbose flag is set to true.

Constructor & Destructor Documentation

◆ BasicRunner()

template<typename Portfolio, typename Strat, typename Streamer>
tzu::BasicRunner< Portfolio, Strat, Streamer >::BasicRunner ( Portfolio & portfolio,
Strat & strat,
Streamer & streamer )
inline

Member Function Documentation

◆ run()

template<typename Portfolio, typename Strat, typename Streamer>
void tzu::BasicRunner< Portfolio, Strat, Streamer >::run ( bool verbose = false)
inline

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