Because our trading strategy buys and sells EUR.USD every day, we must be wary of transaction costs. In the initial backtest we set the one-way slippage at 0.1 basis points, a figure we estimated by logging into Trader Workstation and manually checking the EUR.USD spread. (Our strategy will use market orders and thus we will pay the spread.) We can run a parameter scan to determine how sensitive the strategy is to slippage. We check several values from 0.1 to 2 basis points per trade.
from quantrocket.moonshot import scan_parameters
scan_parameters("fx-bizday",
param1="SLIPPAGE_BPS",
vals1=[0.1, 0.5, 1, 2],
filepath_or_buffer="fx_bizday_SLIPPAGE_BPS.csv")
Plotting the results using Moonchart reveals that our strategy cannot tolerate much slippage. Even 1 basis point will destroy the profitability:
from moonchart import ParamscanTearsheet
ParamscanTearsheet.from_csv("fx_bizday_SLIPPAGE_BPS.csv")