Closed BoudewijnKlijn closed 1 year ago
This PR fixes an unexpected result when a ticker is compared with a benchmark.
If the ticker and the benchmark are identical, the metrics in the report should be identical as well.
In the basic report, the returns of the ticker are prepared: returns = _utils._prepare_returns(returns)
returns = _utils._prepare_returns(returns)
Hence, to get consistent results, the benchmark should also be prepared.
import quantstats as qs qs.extend_pandas() TICKER = 'SPY' returns = qs.utils.download_returns(TICKER) # Create report. Note inconsistent 'Cumulative Return'. metrics = qs.reports.basic(returns, returns)
This PR fixes an unexpected result when a ticker is compared with a benchmark.
If the ticker and the benchmark are identical, the metrics in the report should be identical as well.
In the basic report, the returns of the ticker are prepared:
returns = _utils._prepare_returns(returns)
Hence, to get consistent results, the benchmark should also be prepared.
Code to show old benchmark gives inconsistent metrics