PineForge HPO 0.1.0
Native hyperparameter optimization for PineForge strategies
Loading...
Searching...
No Matches
portfolio.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <unordered_map>
6#include <vector>
7
9
10namespace pineforge::hpo {
11
15 std::int64_t timestamp_ms = 0;
17 double equity = 0.0;
18};
19
21struct Allocation {
23 std::string strategy_id;
25 std::string market_id;
27 double weight = 0.0;
28};
29
33 std::string strategy_id;
35 std::string market_id;
37 double weight = 0.0;
39 double initial_equity = 0.0;
41 double final_equity = 0.0;
42};
43
51 std::vector<AccountEquityPoint> account_equity;
53 std::vector<double> account_returns;
55 std::vector<Allocation> allocations;
57 std::vector<SleeveSummary> sleeves;
59 std::unordered_map<std::string, double> features;
61 double turnover = 0.0;
63 double capital_used = 0.0;
64};
65
68
69} // namespace pineforge::hpo
ObjectiveFn< PortfolioObservation > PortfolioObjectiveFn
Custom objective function specialized for PortfolioObservation.
Definition portfolio.hpp:67
std::function< ObjectiveResult(const Observation &, const TrialContext &)> ObjectiveFn
Type-erased custom objective accepting an observation and immutable trial context.
One timestamped point on an account-level equity curve.
Definition portfolio.hpp:13
std::int64_t timestamp_ms
Unix timestamp in milliseconds.
Definition portfolio.hpp:15
double equity
Total account equity at the timestamp.
Definition portfolio.hpp:17
Requested capital allocation to one strategy and market sleeve.
Definition portfolio.hpp:21
std::string strategy_id
Stable strategy identifier from the study definition.
Definition portfolio.hpp:23
double weight
Portfolio weight assigned to the sleeve.
Definition portfolio.hpp:27
std::string market_id
Stable market or dataset identifier from the study definition.
Definition portfolio.hpp:25
Account-level observation supplied to a custom portfolio objective.
Definition portfolio.hpp:49
std::vector< SleeveSummary > sleeves
Per-sleeve start/end summaries.
Definition portfolio.hpp:57
std::vector< Allocation > allocations
Allocations that produced this observation.
Definition portfolio.hpp:55
double capital_used
Evaluator-defined amount of capital deployed.
Definition portfolio.hpp:63
double turnover
Evaluator-defined portfolio turnover over the observation window.
Definition portfolio.hpp:61
std::unordered_map< std::string, double > features
Objective-specific account features keyed by registered name.
Definition portfolio.hpp:59
std::vector< AccountEquityPoint > account_equity
Time-aligned account equity series.
Definition portfolio.hpp:51
std::vector< double > account_returns
Account returns aligned to the evaluator's chosen interval.
Definition portfolio.hpp:53
Compact start/end summary for one independently evaluated portfolio sleeve.
Definition portfolio.hpp:31
std::string strategy_id
Stable strategy identifier.
Definition portfolio.hpp:33
double weight
Portfolio weight used for this sleeve.
Definition portfolio.hpp:37
double final_equity
Sleeve equity at the end of the observation window.
Definition portfolio.hpp:41
std::string market_id
Stable market or dataset identifier.
Definition portfolio.hpp:35
double initial_equity
Sleeve equity at the beginning of the observation window.
Definition portfolio.hpp:39