1. Home
  2. Docs
  3. DLPAL S
  4. Data Conversion FAQ

Data Conversion FAQ

Can I use Tradestation data with DLPAL?

There are 2 steps involved in converting daily or intraday Tradestation data to files that can be used with DLPAL:

Step 1: Generate a text file from Tradestation

Tradestation historical data can be saved in a .txt file using the following command sequence: View, data window, show all, save

For daily data files you can also use the following function:  print( file( “C:.txt” ), dateformat( “YYYYMMDD”, “”), “,”, O, “,”, H, “,”, L, “,”, C);

For intraday data files you can also use the following function:  print( file( “C:.txt” ), dateformat( “YYYYMMDD”, “”), “,”, time, “,”, O, “,”, H, “,”, L, “,”, C );

where directory is a directory on your C: drive to save the file and filename the name of the file.

Step 2: If a conversion is required (often applies only to intraday data), use the appropriate conversion routine from Tools menu to generate a file compatible with DLPAL: 

– Open the saved file from Step 1 in Notepad and DELETE any header if present. A header is a line with the names of the fields in the file. There should be only data in the file and nothing at the start or end of it, including any blank lines. Also make a note of the particular format of the file, like the date format and what type of delimiter is used.

The following steps apply to intraday data and daily data that include a TIME field:

-From the main program menu select Tools and then Intraday File Creation.
-Select the source file saved in Step 1 and specify the correct file format. UNCHECK the option “Metastock Compatible” if CHECKED.
-Hit Convert and select a new directory to save the new file generated by DLPAL (or you can use the same directory with a different file name) and then click Save to complete the conversion.

The following steps apply to daily data only (saved data from Tradestation that do NOT include a Time field):

– From the main program menu select Tools and then Data file Conversion.
– Select the source file saved in Step 1 and specify the correct file settings.  Make sure you UNCHECK “Metastock Compatible”.
– In the target file settings leave the default DLPAL format and hit Convert. Select a new directory to store the file (or you can use the same directory with a different file name) and click Save to complete the conversion.

Does DLPAL have an interface to eSignal data?

There is no direct interface directly to eSignal but there is a small program Qcollector that converts eSignal data to DLPAL compatible format. You can use that with both daily and intraday data. To download a demo please visit: www (dot) mechtrading (dot) dom

For daily data:

In the options of Q-Collector specify to output the fields Date, Open, High, Low, Close. The fields can be either comma or single space delimited and for the date use the format YYYYMMDD. The output file can be used by DLPAL directly.

For intraday data.

In the options of Q-Collector specify to output the fields Date, Time, Open, High, Low, Close. The fields can be either comma or single space delimited and for the date use the format YYYYMMDD. The time field must have the format hh:mm. The output file cannot be used by DLPAL directly. You must use the Intraday File Creation tool from Tools menu to convert the file to DLPAL intraday format. In both cases above, daily or intraday data, there should be no header in the data file ( The first line of the file is often a header that defines the content of the fields in the records that follow. QCollector gives you the option of whether or not to include an ASCII header in your data files.)

What are the steps for converting data from excel to DLPAL format?

There are two steps involved in using data from excel.

Step 1: Format the date column and then save the file in text format. Make sure the text file has no header line.  In excel, right click on the date column name and then select Format Cells. While at the Number tab, select Custom and then m/d/yyyy. Click OK and the date column cells should be displayed in the right format. Then, select Save as from the File menu and save the file after selecting Text (Tab Delimited) in the drop down Save as type menu. Next, open the file in Notepad and make sure there is no header line present. If there is one delete it and save the file. Make sure no empty lines are present at the top or bottom of the file.

Step 2: Convert the text file to DLPAL format using the conversion Tools from the main menu:

For daily data the procedure is as follows:

– From the main DLPAL menu select Tools and then Data file Conversion.
– Select as the source file the file saved in the previous step. For Source files Setting mark mm/dd/yyyy as the date format and Comma as the separator (Tab is treated as a comma by the conversion tool). Make sure that Metastock compatible box is NOT checked. In the Target File Settings leave the default DLPAL Compatible format and hit Convert. Select a new the directory to save the converted file and click Save to complete the conversion. You may use Windows Explorer to create a new directory.

For intraday files that include a TIME field the procedure is:

– From the main DLPAL menu select Tools and then Intraday File Creation.
– Select the source file and specify the correct file settings (mm/dd/yyyy and comma). Make sure that Metastock compatible box is NOT checked.
– Hit Convert and select a new directory to save the converted file (or the same directory with a different file name) and click Save to complete the conversion.

Can I use data from NinjaTrader with DLPAL?

Data can be exported from NinjaTrader as follows:

(1)  Click Tools, select Historical data and then click Export.
(2)  Select the Instrument to export historical data for and the Data series starting and ending date
(3)  Click OK and then select the data directory and file name
(4)  Click Save to export the historical data

Daily data

DLPAL can read directly the ASCII text format used by NinjaTrader to export historical daily data.

Intraday data

With intraday data export, NinjaTrader does not place a delimiter after the date. Data are exported in the following form (see the NinjaTrader manual under “export”):

20061023 004400;1377.25;1377.25;1377.25;1377.25;86
20061023 004500;1377.25;1377.25;1377.25;1377.25;27
20061023 004600;1377.25;1377.25;1377.25;1377.25;24
20061023 004700;1377.50;1377.50;1377.25;1377.25;82

Note that there is no delimiter after the date.

There are at least two ways of converting the data to a format that can be then converted to DLPAL intraday file:

1. Use a script to output the data in text file in a format that can be converted to DLPAL format. Output the date, time, open, high, low, close separated by a comma. Then use the Intraday File Creation tool from the DLPAL main menu to convert the file to DLPAL format.

2. Use Wordpad and Search and Replace (recommended for quick conversion)

Export a .txt file from NinjaTrader and then open it in Wordpad. Input commas in the space after the date on each line by using Edit-Replace. Just input a space in “Find what” (hit spacebar once) and then input , in “Replace with”. After you replace the blank space after the date with a comma on each line, replace all ; with , using the same method.  Then, convert the file using the Intraday File Creation tool for DLPAL main menu.

You can use the text files generated by NinjaTrader  in DLPAL to search for strategies.

Can I use data from MetaTrader with DLPAL?

You can use the ascii text files exported from MetaTrader to search for strategies with DLPAL but you must first delete the header line, save the file in .txt format and then convert it to DLPAL compatible format. Note that both daily and intraday data exported from MetaTrader are converted by DLPAL as intraday data but that makes no difference to the search. The complete steps to export data from MetaTrader and convert it to DLPAL format are outlined below:

Step1: Data export from MetaTrader:

(1)  Click Tools and then select History Center or hit the F2 key
(2)  Double-click on the instrument to export historical data for and then select the periodicity (for example EURUSD – M5)
(3)  Click Export,  select ASCII Text (*.prn)  in the Save as type field  and specify the target directory and file name
(4)  Click Save to export the historical data

Step 2: Delete header and change the file extension from .prn to .txt. In detail:

(1)  Run Notepad
(2)  Open the MetaTrader text file you saved. Make sure you select All Files as the File or type
(3)  Delete the header line and then make sure there are no empty lines at the beginning or at the end of file.
(4)  Click Edit and then Select All.  Right click mouse and select copy.
(5)  Click File and then New. Select No to ignore changes.
(6)  Right click mouse and select Paste. Warning: make sure there are no blank lines at the start or end of file. If any, delete them.
(7)  Click File and select Save as to save the file. Type in a file name and click Save.

Step 3: Convert the historical data format to DLPAL format

(1)   From the main DLPAL menu select Tools and then Intraday File Creation.
(2)   Select as the source file the file saved  in Step 2 and specify the correct file settings (yyyymmdd and comma)
(3)   Hit Convert and select a new directory to save the file (or the same directory with a different file name) and click Save to complete the conversion.

Now you can use the newly created  text file in DLPAL to search for daily or intraday strategies. Note: Daily data files exported from MetaTrader include a default Time field so they must be converted using the same procedure as with intraday data files.

How to check for errors in data files?

DLPAL has a tool for checking data files for errors, like open and close values outside the High-Low range, spikes and zero values. For more details look for “Data File Test”, under the Tools section of the program manual.

Does daily data use result in misleading backtesting results?

Below is how, in principle, the back-testing algorithm of DLPAL works. At every bar the program checks if there is an open position. The loop goes as follows:

For current bar:

If open long position then

If open of this bar < stop price then
exit at the open
go to next bar
else
If low < stop price then
exit position at stop price
go to next bar
else
if high > target price then
exit position at profit target price
go to next bar

else

if open short position then

If open of this bar > stop price then
exit at the open
go to next bar
else
if high > stop price then
exit position at stop price
go to next bar
else
if low < target price then
exit position at profit target price
go to next bar

go to next bar

The program checks for the stop-loss before it does for the profit target and this produces the most conservative results since one cannot know whether the low or the high of the day occurred first intraday

Should I avoid dividend-adjusted data?

Yes, because they distort price series. Only split-adjusted data should be used.

Can I use point stops with stocks?

Point stops with stock data should not be used when splits in the stock price have been accounted for.

What is the recommended number of bars for the in-sample?

A rule of thumb for determining the minimum number of bars for intraday strategy search is the following: Nbars = 2000 x Np

where Np is the number of bars in the intraday time frame. For example, in the case of hourly US stock data Np = 6.5 and hence Nbars = 19,500.

In the case of hourly Forex data, Np = 24 resulting in Nbars =72,000

Tick data use is not recommended since the Open, High, Low and Close have the same value. Also, it is unlikely that tick data strategies can have any statistical significance at all.

How could the use of non-continuous futures data affect DLPAL?

If continuous data cannot be used for some reason and if the rollover changes are small, the performance of a strategy will only be affected if it has a trade open when the rollovers occur. For a trading system with a sufficient large number of strategies, the average error due to rollover will be close to zero because some trades will gain and some will lose. The problem arises only with individual strategies with a small number of trades.

How to deal with negative values in continuous futures?

Some continuous futures contracts include negative values that arise from the rollover adjustments. Negative values should not be used with DLPAL. A simple way of adjusting this type of contracts for use with DLPAL if via an upward shift that involves adding a positive value to all price fields that is equal to the largest negative value. However, when such method is used the profit target and stop-loss must be always expressed in points and not as a percentage of price because in the latter case the performance results will be misleading as percentages of adjusted data do not equate to percentages of unadjusted data. To see this consider a profit target of T% of the entry price P which equates to a target of PxT/100. If P is shifted upwards by an amount equal to s then the new profit target is at (P+s)xT/100 and it is now different. When T is in points, the profit target price is still equal to T when data is adjusted by s and thus the backtest results are invariant under a simple data shift in conjunction with point exits and in the case of future contracts that have a fixed tick value. If a data shift is not desired for some reason, the part of the data file that involves negative values can be removed if it occurs in the far past.

How can I update my data files and where can I save them?

Data for DLPAL can be saved as a text file in the proper format in any directory on the hard drive. The data files included with the program are just examples. Normally a script or some type of program is required to download data from a vendor and update files in the directories on the hard drive. There are many ways of generating data for DLPAL because the data format it uses is simple and easy to define and handle.