Run backtest

We can now run our backtest from the QuantRocket client. The API for the satellite service lets us execute an arbitrary Python function or shell command and optionally return a file. In our case, we'll execute the run function in our Python script and tell QuantRocket to return the PDF performance chart that our script will create.

In [1]:
from quantrocket.satellite import execute_command
execute_command("codeload.backtrader_dma.dual_moving_average.run",
                return_file="/tmp/backtrader-plot.pdf",
                filepath_or_buffer="backtrader-plot.pdf")

Finally, open the resulting backtrader-plot.pdf and have a look at the results.