Backtesting is the process of testing an automated trading strategy using historical data to ensure its viability before the trader risks running it on a live account. The trader can simulate the trading of a strategy over a defined period of time and analyse the results for the levels of profitability and risk.
Why Do You Need to Back-Test?
If you start using an automated trading robot and the symbol parameters are incorrect then you will probably lose money, the parameter settings you use with your trading robot (cBot) are very important and there are a few methods available to you to find the best settings to give me maximum net profit with the lowest equity drawdown.
Manually Adjust Symbol Parameters
One option is to manually adjust your cBot parameters and run a backtest, this is our preferred method as you are not fitting the sample data to your settings and when you start using fresh data you may have a higher probability of good results, but this is not always the case as sometimes fitted data from using optimized parameters can also provide excellent results with fresh data. It is best to experiment with both manual and optimized parameters.
You should never backtest or optimise your trading system on a virtual private server (VPS), this is due to the fact that they use a huge amount of RAM and CPU to crunch the numbers, instead, you should backtest and optimise on a powerful PC and when you have the desired settings you can apply these to the VPS server.
How to Back-Test Your cBot
This article assumes that you already have a good set of symbol parameters are you just want to run tests with historical data to simulate live trading, the cTrader platform has a module for backtesting and to get started you first need to make sure you are looking at the automated trading screen, just click on the button shown in green on the left-hand side of the screen to open it.
Your first step is to add a symbol instance to the robot you wish to backtest.
You will see the default parameters shown in the cBot, you can either manually adjust them or load predefined parameter settings.
Your next step is to click on the backtesting tab shown at the top of the screen.
The image above shows the backtest screen ready for configuration, your first step is to set the date range of the test, above you can see it is from the 09/10/2018 to the 08/11/2018, you can use any date you wish by either using your mouse to adjust the slider or changing the start and end dates.
Once you are sure that you have the settings you want in the cBot, your next step is to configure your backtest settings for the trading you want to simulate.
- Starting Capital - this is the trading capital that you want to simulate.
- Commission - this is the commission your broker charges per million, you can find this information on your broker's website.
- Data - This is the type of you wish to use, the m1 bars will provide the open prices only, the spread is in-built and can be set as a fixed value.
- Spread - this is the fixed spread you wish to use for all trades, this is not available for tick data.
- Random - this is the random spread you wish to use between the minimum and maximum values, this is not available for tick data.
** If you use Tick Data then the real historical spread is included in the data.
The final step is to run the backtest, to do this just click on the play button at the top right, if you have the history tab open beneath you will see the actual historical simulated trades.
What Is Visual Mode?
The visual mode feature built into the cTrader platform is a game changer, this allows you to visually see the trading system in action, try it out by checking the box and running a backtest, you can adjust the speed on the right-hand side to speed things up or slow it down. Also, open the historical trades tab below to see the life of trade from birth to death.
Some common problems that may occur when you run a backtest and no results are shown is explained below.
Sometimes no results are shown when you run a backtest because the Max Spread parameter in the robot is higher then the fixed spread that has been set in the backtest settings if this happens just set the max spread parameter in the robot to a much higher value.
Another common problem is that one or more parameters in the cBot are incorrect.
If you have created the trading robot yourself or downloaded it from another company then there could be a problem in the actual logic of the trading system.
Need More Help? Watch This Video
The video has been uploaded to 1080p High Quality, so do not forget to set your U-Tube video quality to 1080p HD. Expand to full screen with icon bottom right of the video.
Duration: 14 minutes
How to Buy Historical Market Data
If you wish to purchase and download historical market data for the cTrader trading platform for any symbol then we can provide you with the data, if we do not have the data in our web store then just contact us and we will create it for you.