calculate_daily_returns#
API documentation for tradeexecutor.visual.equity_curve.calculate_daily_returns Python function.
- 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:
freq (pandas._libs.tslibs.offsets.DateOffset | str) – Frequency of the binned data.
state (State) –
- Returns:
If valid state provided, returns are returned as calendar day (D) frequency, else None
- Return type:
pandas.core.series.Series | None