Skip to content

Rolling

QuantConnect.Report.Rolling

Bases: Object

Rolling window functions

beta

beta(
    performance_points: SortedList[datetime, float],
    benchmark_points: SortedList[datetime, float],
    window_size: int = 132,
) -> Any

Calculate the rolling beta with the given window size (in days)

Parameters:

Name Type Description Default
performance_points SortedList[datetime, float]

The performance points you want to measure beta for

required
benchmark_points SortedList[datetime, float]

The benchmark/points you want to calculate beta with

required
window_size int

Days/window to lookback

132

Returns:

Type Description
Any

Rolling beta.

sharpe

sharpe(
    equity_curve: Any,
    months: int,
    trading_day_per_year: int,
) -> Any

Get the rolling sharpe of the given series with a lookback of months. The risk free rate is adjustable

Parameters:

Name Type Description Default
equity_curve Any

Equity curve to calculate rolling sharpe for

required
months int

Number of months to calculate the rolling period for

required
trading_day_per_year int

The number of trading days per year to increase result of Annual statistics

required

Returns:

Type Description
Any

Rolling sharpe ratio.