Multi-Country Backtest

Next, we test the strategy by running a backtest on all the countries we have data for. Multi-country backtests serve two purposes:

  1. Market Selection: They help identify the particular market where a strategy works best so we can focus our subsequent research there.
  2. Idea Validation: They help validate a trading idea by demonstrating how widely it applies. A backtest that performs well across several global markets is more robust than one tested on a single market. Even if we focus only on the most promising market, the performance in other markets can bolster our confidence that the anomaly we aim to exploit is genuine.

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:

In [1]:
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:

In [2]:
from moonchart import Tearsheet
Tearsheet.from_moonshot_csv("dead_cat_drop_backtest_results.csv")