algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
bootstrap.hpp File Reference

The prices of a bootstrap path, rebuilt from drawn blocks joined to the path and put on the instrument's price grid. More...

#include <algotradelib/core>
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
Include dependency graph for bootstrap.hpp:

Go to the source code of this file.

Classes

struct  algotradelib::backtest::Returns
 Chains the drawn returns: a path price is the path's previous close times value / from. More...
struct  algotradelib::backtest::Differences
 Chains the drawn changes (Paparoditis and Politis): the path's previous close plus value - from. More...
struct  algotradelib::backtest::Levels
 Joins the drawn prices as they are (Künsch; Politis and Romano): for a stationary series, not trending prices, where each block boundary is a jump. More...
struct  algotradelib::backtest::is_price_join< Join, typename >
 Whether Join can join drawn blocks: true when a const Join has a member join(double, double, double) returning something convertible to double. More...
struct  algotradelib::backtest::is_price_join< Join, std::enable_if_t< std::is_convertible_v< decltype(std::declval< const Join & >().join(double{}, double{}, double{})), double > > >
 A join with the member join that resample_closes and resample_bars call. More...

Namespaces

namespace  algotradelib
 The library: broker-neutral types (core), and the modules below.
namespace  algotradelib::backtest
 Replays a strategy over stored bars: fill and cost models, the replay ledger, and the report.

Functions

template<typename Join = Returns>
std::vector< Decimal64 > algotradelib::backtest::resample_closes (const std::vector< Decimal64 > &closes, const PriceRule &rule, const std::vector< std::size_t > &indices, const Join &join=Join{})
 Rebuilds one instrument's closes along a bootstrap path (analytics::bootstrap_indices), joining the drawn blocks by Join, and rounds each to its nearest grid price, a tie going up.
template<typename Join = Returns>
std::vector< Bar > algotradelib::backtest::resample_bars (const std::vector< Bar > &bars, const PriceRule &rule, const std::vector< std::size_t > &indices, const Join &join=Join{})
 Rebuilds one instrument's bars along a bootstrap path (analytics::bootstrap_indices): each drawn day's prices joined to the path's previous close and rounded to their nearest grid prices, a tie going up.

Detailed Description

The prices of a bootstrap path, rebuilt from drawn blocks joined to the path and put on the instrument's price grid.

Definition in file bootstrap.hpp.