QuantRocket logo
Disclaimer


Borrow Fees Alpha › Part 5: Moonshot Backtest


Moonshot Backtest¶

Let's see how the strategy performs. First, run the backtest:

In [1]:
from quantrocket.moonshot import backtest
backtest(
    "short-high-borrow",
    start_date="2018-04-16", # start date of the borrow fees data
    end_date="2024-04-30",
    segment="Y",
    filepath_or_buffer="short_high_borrow_backtest_results.csv"
)

Then, view a tear sheet. Here, we use the start_date parameter to limit the tear sheet to after the pandemic. High borrow fee stocks surged during the pandemic, resulting in massive losses for this strategy that make it hard to see the strategy's behavior during calmer, more typical periods. In typical periods, the strategy is profitable before fees but is roughly flat when taking fees into account.

In [2]:
from moonchart import Tearsheet
Tearsheet.from_moonshot_csv("short_high_borrow_backtest_results.csv", start_date="2021-03-01")

Next Up¶

Part 6: Zipline Strategy Code