December 2018
Beginner to intermediate
684 pages
21h 9m
English
Testing a trading strategy involves backtesting against historical data to fine-tune alpha factor parameters, as well as forward-testing against new market data to validate that the strategy performs well out of sample or if the parameters are too closely tailored to specific historical circumstances.
Pyfolio allows for the designation of an out-of-sample period to simulate walk-forward testing. There are numerous aspects to take into account when testing a strategy to obtain statistically reliable results, which we will address here.
The plot_rolling_returns function displays cumulative in and out-of-sample returns against a user-defined benchmark (we are using the S&P 500):
from pyfolio.plotting ...