sigmaquant.performance.metrics.period_hit_rate#
- sigmaquant.performance.metrics.period_hit_rate(returns, frequency)#
Compute the hit rate on aggregated periods.
The function aggregates returns at the specified frequency and computes the hit rate for each aggregated period. A period is considered a “hit” if the aggregated return is strictly positive.
- Parameters:
returns – Time series of periodic returns indexed by datetime.
frequency –
- Aggregation frequency:
”D”: daily
”W”: weekly
”M”: monthly
”Y”: yearly
- Returns:
Time series of hit rate computed on aggregated periods. Each value represents the fraction of positive observations within the corresponding period.
- Return type:
pandas.Series