alpheast.portfolio.benchmark_calculator module

class alpheast.portfolio.benchmark_calculator.BenchmarkCalculator(symbols, transaction_cost_percent=Decimal('0.001'), slippage_percent=Decimal('0.0005'))[source]

Bases: object

Manages the calculation and tracking of benchmark portfolio values.

initialize_benchmark_holdings(initial_cash_total, current_market_prices)[source]

Initializes the benchmark holdings by equally weighting the initial cash across all symbols. This is called once at the first daily update.

calculate_and_record_benchmark_value(current_date, latest_market_prices)[source]

Calculates the benchmark’s total portfolio value for the current day and appends it to the benchmark daily values history.

is_initialized()[source]
Return type:

bool

get_daily_values()[source]
Return type:

List[Dict[str, Any]]