Some trading applications don't support backtesting of strategies trading instruments denominated in different currencies at the same time. BTAnalytics solves this issue, allowing accurate multi-currency backtesting.
To do multi-currency backtesting, you need to specify a base currency in which all of the performance metrics and charts of the backtest results will be shown. Also, the simulation engine must have access to the exchange rates between the different currencies in which the instruments are denominated and the base currency in the period of the backtest.
Let's see an example using the Wealth-Lab trading software (more or less the same can be applied to all trading platforms):
In this case, the trading platform (Wealth-Lab) doesn't support multi-currency backtests natively, but luckily BTAnalytics does!
Let´s assume that we have three different strategies, each one trading stocks denominated in a different currency.
- "Dip Buyer 1" trades 100 stocks denominated in CAD.
- "RSI Buyer 1" trades 100 stocks denominated in USD.
- "MA Buyer 1" trades 100 stocks denominated in EUR.
for this example, we want USD as the base currency of our simulation.
Preliminary (one time) BTAnalytics configuration: Configure exchange rates in BTAnalytics.
BTAnalytics will need to convert prices from EUR to USD and from CAD to USD in order to make the simulation, so we need to import exchange rates data for each of the currency pairs involved.
For the conversion from EUR to USD, we will use data for the EURUSD currency pair. In this data, USD is the base currency, and EUR is the quote currency, so to convert from EUR to USD BTAnalytics will multiply the EUR prices by the exchange rate.
For the conversion from CAD to USD, the USDCAD currency pair will be used. In this case, CAD is the base currency, and USD is the quote currency, so BTAnalytics automatically will multiply the CAD prices by 1 / exchange rate.
In BTAnalytics, go to Settings -> Currency Exchange Rates menu.
Currency Pairs Exchange Rates Configuration Dialog
Currency Pair Exchange Rates Historical Data
Import Exchange Rates Historical Data Dialog
The currency pairs data used was downloaded for free from https://www.global-view.com/forex-trading-tools/forex-history/index.html as a CSV file and had the following format:
So we created a new import format in the BTAnalytics exchange rates import tool called "global-view" as follows:
Exchange Rates Historical Data Importing Text Format Configuration Dialog
To get the exchange rate for a date and time, BTAnalytics will use the exchange rate belonging to the nearest date and time in the imported data. You can import exchange rates in any time frame, including intraday. Also, you can set a fixed exchange rate between any two currencies in the simulation.
Once BTAnalytics has been configured to handle currency conversions in multi-currency simulations, it's time to backtest our multi-currency and multi-strategy trading system.
Step 1: Simulate the strategies and export the results to BTAnalytics:
The first step is to simulate each of the strategies independently and export the results to BTAnalytics.
If you are simulating using the Wealth-Lab native strategy simulator, AFTER executing the simulation, you should set the "Account Currency" field in the "BTAnalytics Data Feeder" visualizer tab to the currency of the simulated instruments and then export the backtest to BTAnalytics.
Data Feeder UI
If you are using the BTSimulator tool of BTUtils for Wealth-Lab, then BEFORE executing the simulation, you should set the "Account Currency" field in the "BTAnalytics Data Feeder" visualizer tab to the currency of the simulated instruments, then run the simulation and finally export the backtest to BTAnalytics.
BTSimulator Data Feeder UI
- When you do that for the three strategies, you will see the three Raw Simulations in BTAnalytics Studies Explorer. Each Raw Simulation has symbols denominated in a different currency.
BTAnalytics Studies Explorer showing the imported simulations.
Step 2: Combine the three simulations in BTAnalytics:
Simply select the three raw simulations at the same time (holding the Ctrl key in the keyboard at the same time that you click on them) in the studies explorer and then click on the Home -> Combine Raw Simulations. Alternatively, you can utilize the Home -> Raw Simulation Builder tool. Set a name for the new combined raw simulation, a destination folder, and build it.
Raw Simulation Builder
This is a good time to clarify the terminology used by BTAnalytics:
Tactic: The code containing the rules of the trading system.
Strategy: The Tactic + DataSet
Now you have a combined raw simulation with the trades of the original three simulations.
New Combined Raw Simulation
Step 3: Build a new simulation of the combined raw simulation:
Select the combined raw simulation in the Studies Explorer and click on Home -> New Simulation
Then set the Simulation Currency (USD in our example), simulation settings, and position sizing options for the simulation. You can click on the "Exchange Rates Config" button to configure how the conversion will be done.
Simulation Builder - General Settings
Exchange Rates Configuration
Simulation Builder - Position Sizing
Lastly, select a name for the simulation and click on Simulate.
The multi-currency simulation will be created. If you open the new simulation, you will see the equity in that simulation denominated in the simulation currency that you selected before.
If your Trading Platform doesn't support multi-currency backtesting, then you can use BTAnalytics to solve that limitation easily. BTAnalytics supports true multi-strategy, multi-instrument portfolios, multi-time frames, multi-instrument types, and multi-currency simulations in a truly versatile fashion in order to help you build robust and winning trading systems.