Moonshot Strategy Code

Because Moonshot is Pandas-based, our interactive strategy code can readily be transferred to a Moonshot strategy. The file fx_bizday.py contains our transferred strategy code. We've added FX commissions and one-way slippage of 0.1 basis points.

Install strategy file

Moonshot looks for strategies inside the "moonshot" directory, so execute the following cell to "install" the strategy by moving the file to that location:

In [1]:
# make directory if doesn't exist
!mkdir -p /codeload/moonshot

!mv fx_bizday.py /codeload/moonshot/

Run backtest

Next we can run the backtest:

In [2]:
from quantrocket.moonshot import backtest
backtest("fx-bizday", filepath_or_buffer="fx_bizday_backtest.csv")

And view the performance:

In [3]:
from moonchart import Tearsheet
Tearsheet.from_moonshot_csv("fx_bizday_backtest.csv")

Next Up

Part 5: Parameter Scans