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.
Moonshot looks for strategies inside the "moonshot" directory, so execute the following cell to "install" the strategy by moving the file to that location:
# make directory if doesn't exist
!mkdir -p /codeload/moonshot
!mv fx_bizday.py /codeload/moonshot/
Next we can run the backtest:
from quantrocket.moonshot import backtest
backtest("fx-bizday", filepath_or_buffer="fx_bizday_backtest.csv")
And view the performance:
from moonchart import Tearsheet
Tearsheet.from_moonshot_csv("fx_bizday_backtest.csv")