Clickalgo Knowledge Center
Return to Website

How to Load CSV Forex Data Into cTrader

Learn how to load historical market data into the cTrader trading platform to test your automated trading systems (ATS) over a longer timeframe to capture as many market conditions as possible. The data that is provided by your broker is loaded into the cTrader trading platform when you backtest your automated trading systems (ATS) with historical market data. 

Before backtesting, you will have the option to choose a data source - Either one-minute trend bars from a broker server or one-minute trend bars from a CSV file on your local disk. If you choose to use a CSV file you will need to specify its location, after which cAlgo will analyze the file and adjust minimum and maximum available dates for backtesting.

 

Step 1.

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.

ctrader backtest module

Once you are in the Automate module of cTrader you need to select your cBot and make sure you have a cBot instance added, if you need help just follow the link below.

How to Add a cBot Instance

 

Step 2.

Now that you have a cBot instance, you need to select your symbol and trading parameters for the automated trading system, on the screen to the right at the top you will see 3 options as shown below, make sure you select the Backtesting tab.

 

ctrader backtest tab

 

Step 3.

Now you can add your symbol CSV market data file into the cTrader platform for a deeper backtest, to do this just click on the settings icon top left to open the backtest settings window. Then select the data you wish to use, in the case it is the m1 bars in CSV-file as shown in no. 2. Now the last step is to select the file on your machine by clicking on the folder icon as shown below in no. 3, a dialogue window will appear just navigate to where your CSV file is located on your machine and select it.

 

ctrader load csv file backtest data

ctrader import csv

 

Also, select your Spread as a fixed value, just copy the current live value by clicking the green button, be careful, if the markets are closed this value can be incorrect and very high, just look it up on your broker's website instead.

 

How to Check If the Data Loaded Correctly?

To check if the CSV data has loaded into cTrader correctly you can look at the start and end dates as shown below and you should see the sliders at each end of the control, in the example below shows data from 11.11.2012 - 17.09.2014

 

ctrader backtest dates

 

Step 4.

The last step involves the actual backtest if you are unfamiliar with backtesting using cTrader just follow the instructions below.

How to Backtest Using cTrader

 

The CSV Market Data File Format

In order to use trend bars from the file you will have a comma-separated CSV file with the following columns:

  • Date
  • Time
  • Open Price
  • High Price
  • Low Price
  • Close Price
  • Volume

 

Example:

2003.06.18,16:01,1.11423,1.11428,1.11332,1.11374,19
2003.06.18,16:02,1.11364,1.11436,1.11361,1.11405,7
2003.06.18,16:03,1.11402,1.11455,1.11400,1.11440,5
2003.06.18,16:04,1.11446,1.11461,1.11401,1.11447,14

 

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.

How to Download Historical Market Data