Next, we test the strategy by running a backtest on all the countries we have data for. Multi-country backtests serve two purposes:
At this stage, since we're only trying to validate the basic concept, we don't yet model commissions or short sale constraints. We will save those steps for a subsequent notebook.
We omit the most recent years from the backtest so that we can run an out-of-sample backtest later:
from quantrocket.moonshot import backtest
backtest(
[
"dead-cat-drop-canada",
"dead-cat-drop-eurozone",
"dead-cat-drop-hongkong",
"dead-cat-drop-japan",
"dead-cat-drop-sweden",
"dead-cat-drop-switzerland",
"dead-cat-drop-uk",
],
start_date="2007-01-01",
end_date="2017-12-31",
segment="Y", # Run backtest in 1-year segments to limit memory usage
filepath_or_buffer="dead_cat_drop_backtest_results.csv",
)
Then view the tear sheet. While the strategy does not appear equally attractive in all markets, it does have a positive return in all markets, strengthening the hypothesis that the edge might be real:
from moonchart import Tearsheet
Tearsheet.from_moonshot_csv("dead_cat_drop_backtest_results.csv")