Crypto backtesting
Loading...
Searching...
No Matches
core.h File Reference
#include "constants.h"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <ranges>
Include dependency graph for core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  fx
 Core routines that don't depend on any other fx routines.

Functions

template<typename T = size_t>
constexpr T fx::to_size (std::ranges::range auto &&xs)
 Calculate size of a series, return type depends on input param.
constexpr auto fx::to_first (std::ranges::range auto &&xs)
 Return the first entry in a series.
constexpr auto fx::to_sum (std::ranges::range auto &&xs)
 Calculate sum of series.
constexpr auto fx::to_sum2 (std::ranges::range auto &&xs)
 Calculate sum of series.
constexpr auto fx::to_profit (auto &&entry, auto &&exit)
 Calculate profit from a trade.

Variables

constexpr auto fx::to_last
 Return the last entry in a series.
constexpr auto fx::identity = [](auto &&xs) { return xs; }
 Just passing through.
constexpr auto fx::identity2
 Just passing through.