User Tools

Site Tools


customising_a_file_export

Customising your File Export

In some cases, you may need to customise your file format so it is suitable for importing into your trading platform. In this case, the system allows you the flexibility of defining exactly what your export should contain and what it should look like. The format allows you to output various fields, such as the current symbol, the bid price and so forth, using special tokens such as {Symbol} and {BidPrice}. When the system encounters these tokens, it will automatically translate it into the corresponding information for that instrument. For example, when outputting tick data, if you define a data format like:

{Symbol},{BidPrice},{AskPrice}

the resulting output in the file will look something like:

EURUSD,1.011,1.013

To begin definiting your custom data format, firstly select the 'Custom' button. This will enable all the fields that allow you to specify your custom file format.

Defining a header

The header is a single line at the start of the export file which defines the names of the columns that are contained within the export. To output a header in the data file, firstly ensure that the 'Include header' checkbox is checked. You can then specify the header content, which can be a combination of free text and special tokens. See the section on 'Special tokens' for a list of tokens you can output.

Defining a Data Format

The custom data format field allows you to use a combination of free text and special tokens to specify your output format. Let's just say that we have a trading platform that we wish to export data for. In order to import the data, the trading platform requires that we import daily bar data in the form of:

<Symbol>,<Date YYYY-MM-DD HH:mm><Open price>,<High price>,<Low Price>,<Close price>,<Volume>

In order to do this, firstly clear the contents of the “data format” box, so we can start from scratch. Then, click the drop-down button to the right of the text box and select the option 'Symbol→Mnemonic'. You will note that the format now contains the special token:

{Symbol}

in the text box. Also note the example output box which will shows you what your format looks like. For the moment, all your data will contain is the instrument symbol (eg. EURUSD) for every row of data. In our case, because we are outputting daily data (and your timeframe should be set to 'Daily'), we will have one row of data per day for the entire begin to end period we have selected. Next, press the drop-down button again and select the option “Special→Comma”. Your format should now look like:

{Symbol},

Note again that the example format has updated to show you what your output will look like. Let's now add the next field - the date. Again press the drop-down button and select the option “Bar→Begin date-time”. You will note that the format looks something like:

{Symbol},{BarBeginTime:yyyyMMdd HH:mm:ss}

Looking at the example output format, it's not quite in the format we require, though! It looks something like:

EURUSD,20121112 14:57:00

But we need it to look like:

EURUSD,2012-11-12

To do this, manually edit the custom format so it only specifies the date portion of the date/time and add the hyphens between the year, month and day so your format now looks like:

{Symbol},{BarBeginTime:yyyy-MM-dd}

Perfect! Now continue to add the rest of the commas, followed by the special bar fields for Open, close, high and low prices, so your format finally looks like:

{Symbol},{BarBeginTime:yyyy-MM-dd},{Open},{High},{Low},{Close},{Volume}

Note the example output format - it now looks exactly like what our trading platform expects:

EURUSD,2012-11-12,1.20112,1.2034,1.2001,1.2033,1.3

For further information see the section on 'Special tokens' for a list of tokens you can output. See the section on 'Viewing the sample file format' to see an example what your output data file will look like.

Previewing your Custom File Format

The 'example output' box displays a sample output of how your generated data file will look like. If you like, you can highlight the contents in this box, press CTRL-A to select all the text, press CTRL-C to copy it to a clipboard and then have a look at it in an editor (or even paste it into Excel) to check the format more closely. Of course, the sample format is just that - a sample. The real data will be outputted to the file once your data extract has completed.

Video Demonstrations

Below are two videos which explain how to export both tick and bar data into your own custom file export. Note that these videos feature 'Closed Captions' (CC) which you should switch on to get a text narration in your local language.

Exporting Historical Bar Data

Exporting Historical Tick Data

customising_a_file_export.txt · Last modified: 2020/04/29 02:36 (external edit)