calculate_daily_returns#

calculate_daily_returns(state, freq='D')[source]#

Calculate daily returns of a backtested results.

Used for advanced statistics.

Warning

Uses equity curve to calculate profits. This does not correctly handle deposit/redemptions. Use in backtesting only.

Parameters:
Returns:

If valid state provided, returns are returned as calendar day (D) frequency, else None

Return type:

pandas.core.series.Series | None