Premium Market Analysis, Trader Education, Software, and Trading Strategies. Thirty Years Of Skin In The Game

DLPAL Software FAQ

General FAQ  Workspace FAQ  Data FAQ

General FAQ

Is DLPAL a neural net program?

DLPAL is not a typical neural net program. It uses a deep learning algorithm for supervised and unsupervised learning developed by Michael Harris.

If everyone uses DLPAL will that affect the strategy performance?

There are so many different markets, so many different strategies and so many different ways traders can approach strategy development  (in terms of profit targets, stop-loss, profitability, risk management, etc.) that makes this question a philosophical one rather than practical. Of course, trading very liquid markets reduces the risk of being part of a hypothetical “herd” using the same system.

Are the strategies discovered by DLPAL particular to a certain market?

Although with DLPAL you can discover strategies particular to a certain stock or futures contract, it turns out that many of those strategies work for a group of stocks or even future contracts. DLPAL can discover strategies that are common to a large universe of securities.

Are the strategies found by DLPAL preprogrammed in a database?

There are no hard coded strategies in DLPAL. Instead, DLPAL uses deep learning principles guided by major cluster types. DLPAL does not look for traditional chart strategies but for price action strategies. Some of the strategies the program finds may look similar to traditional chart formations.  Strategies have up to 9 price bars lookback period. That does not include the delay bars. The program finds strategies dynamically as it goes through a data file of historical prices and they are specific to the data used although it may turn out that some of the strategies work for a group of securities.

Can DLPAL consider volume or other indicators in the search for strategies?

DLPAL discovers price strategies that fulfill user-defined risk/reward and performance criteria. The strategies do not consider volume information, only the open, high, low and close of price bars. There is a way of modifying the input data to identify volume strategies.

What is the p-Indicator?

The p-Indicator is a technical short-term indicator developed by Michael Harris for his trading. This novel indicator is based on short-term strategies identified by DLPAL algorithm. The value of the p-Indicator is calculated as the ratio of the sum of the success rate P of each strategy that generates a signal weighted by the number of its historical trades T in the data history to the sum of the trades of all those specific strategies. The p-Indicator can be thought of as having two parts: one to be used for taking long positions and the other for short positions. The calculation of each of the two parts is identical but in the long part of the indicator, the historical success rate P of strategies with long signals is considered and in the short part that of strategies with short signals.

The p-Indicator constitutes the basis for the development of DLPAL LS software

 

What is the recommended way of running multiple instances of DLPAL?

The recommended way of running multiple instances of the open/lifetime license is to create multiple installations of the program in different directories, such as in: C:\DLPAL1, C:\DLPAL2, C:\DLPAL3, etc. One important restriction is that each instance of the program when it runs must NOT share data files from the same directory with any other instance.

Important note: The multiple instances were designed to run workspaces that are created and saved only after the instance is loaded. This is because in some Windows systems the relevant directory is only shown under “Create New Workspace. All other options use the last directory stored in the Registry. If you start a new instance and select “Open Existing Workspace”, the directory shown depending on your system configuration may be the one of the last saved workspace and its corresponding instance, not of the current instance. You can however get around this by selecting the MyWork sub-directory of the particular instance. If you do not know in which directory the instance is located, you can just select Create New Workspace and you will see the relevant directory. You can then exit and select open workspace, go to the relevant directory and select the workspace you want. In addition, when you save the workspace you must make sure it is saved in the relevant directory because in some system the directory of the last instance will apply.

Alternatively, there is a way to simplify the process as follows: You can create a common directory for all instances to save the workspaces, like “C:\DLPALWRK” and another common directory to save all results, like “C:\DLPALRES”

After installing a new instance you can create the workspace you like and save it in the common directory, by the name WRKn, for example, where n is the instance number. Then, after running each instance, you can open the workspace from the common directory.

The above takes some initial work but the time is negligible compared to the time saved running the multiple instances. It has also the advantage of aggregating workspaces in one place.

What is the difference between Test Strategies, Back-test, Back-Test Portfolio and Portfolio Backtest?

1. Test Strategies: This function calculates the performance of all strategies in the results on a data sample that has the same file name as the one shown in the results and it can be used for out-of-sample testing. Selection from results is ignored.
2. Back-test (right mouse click): back-tests single strategies from the search, scan or system tracking results.
3. Back-test Portfolio (right mouse click): This function calculates the performance of single strategies on a portfolio of symbols.
4. Portfolio Backtest: This tool calculates the performance of each of the strategy in the search or scan results on a portfolio of symbols. It is equivalent to applying #3 for all strategies without the performance details.

Hint: Option #3  above will generate the same results as #1 if the portfolio contains only one symbol that is the same as that in the results

DLPAL cannot find the file when I try to use the Backtest or Test Strategies tools

The name of the file used with the back-test or Test Strategies tools must be identical to that shown on the results workspace. Otherwise the program will generate an error message that the file was not found. The same error message is generated if the file name, excluding the path and the .txt extension, is greater than 26 characters. Important: Always double-click on a directory to select it. Only the directory structure is shown, not the files.

How to implement DLPAL strategies and systems in NinjaTrader?

As soon as you find a strategy you like in DLPAL using the historical data you export from NinjaTrader (NT), you can generate code for the strategies in NT script and then you can implement a system with the extra code you desire (with money management, position sizing, etc). Then this system generates the orders through the broker you use with NT when the signals are generated.

Why DLPAL does not have an option for exits based on ATR?

According to the system development philosophy of DLPAL any exit that “adapts” to market conditions may produce fitted systems. Specifically, by adjusting exits to adapt to short-term volatility, which is what ATR accomplishes, the entry part of a system tends to become less significant. By selecting exits that fit any signals to the data random systems may be developed. Instead, the philosophy of DLPAL is that signals should perform well for small constant exit thresholds and if a security shows strictly increasing volatility as a function of time then it should not be used for creating automated systems not because it cannot be traded but because adapting to the volatility during the design phase will create fitted systems. Fortunately, most popular securities and markets exhibit volatility cycles. The profit-target and stop-loss can be calculated as the average of actual changes or percentage:

daily changes: abs(close – close of n bars ago)                                         percentage changes: 100 x abs[(close/close of n bars ago )-1]

where abs stands for the absolute value and n is set to the expected average trade duration, which must be less or equal to maximum strategy length of 9 bars in DLPAL. It has been determined in the finance literature than memory in price series is slowly lost after 4 to 5 bars and as a result any type of exits that close positions after many bars may contribute to the creation of fitted systems.

Can DLPAL use multiple CPU cores in parallel?

DLPAL is not a multi-threaded application because a substantial investment is required for rewriting the code to use multiple cores in an effective way and not in some pseudo manner done by other applications. With that price would have to increase beyond levels that the average trader can afford. However, we offer an alternative solution for those users that have already determined that DLPAL suits their needs in the form of an upgrade that allows multiple instances to run on the same machine with use of sub-clusters. 

Why I do not get any search results?

There are several reasons for not getting any results. Below are a few recommendations:

(1) The markets and timeframes tried may have become too efficient for the parameters specified, including the target and stop levels. Usually futures and forex markets, especially in intraday timeframes, provide very few tradable strategies.
(2) The stop-loss must be set outside the 1-bar volatility range. Stops are checked immediately before profit targets to produce conservative backtests and if the stop-loss is too low no significant strategies will be found.
(3) Test Sample size setting:  For daily data the default of 500 bars should be good enough but for intraday data values greater than 1,000 are appropriate depending on timeframe.
(4) Properly back-adjusted continuous data for futures contracts must be used.
(5) Appropriate values for the profit-target and stop-loss must be used. In the case of futures point values should be used in the T/S file. More details can be found under “A short note on using targets and stops” in “Creating a T/S File” in the program manual.
(6) Workspaces must be created by first selecting the exit type and then creating a search line? It is always a good idea to check the search lines to see if the proper parameters are selected before running the workspace.

Workspace FAQ

What is the difference between the scan and system tracking functions?

The scan function can be used to determine whether there are any strategies with signals as of the close of the most recent bar in daily data that fulfill the user-defined criteria set on the scan workspace. Here is a partial list of what one can do with the scan function:

System Tracking determines which strategies in a saved system generate a signal as of the last day in the data file, on the close or open of next day. In case the close was used as the trade input, system tracking determines the conditions that must be met on the following day’s bar to have a signal at the next close.

How to determine the minimum % profitable for long and short?

The formula for the minimum profitability P is:  P = 100/(1+ Rwl)

where Rwl is the ratio of average winner to average loser and for fixed dollar size trades it can be approximated by the ratio of profit target to stop loss. P is the ratio of winning trades to total trades times 100.

To account for slippage, commissions and other things it is better to use the following adjusted formula: P > 100/(1+ 0.6*Rwl)

Example 1: for profit target to stop-loss ratio of 2:1 the minimum P is 33%. The recommended value is: P > 45%
Example 2: for profit target to stop-loss ratio of 1:1 the minimum P is 50%. The recommended value is: P > 62.5%

For a desired profit factor PF value, the above formula becomes:

P = (100xPF)/(PF+Rwl)

One can solve the above formula for the minimum profit factor required as a function of profitability P and ratio of avg. win to avg. loss Rwl:

PF = (P x Rwl) / (100 – P)

DLPAL includes a Profitability Calculator in the Tools of the main menu. The calculator can be used to get an estimate of the minimum profitability P to use on a search workspace when an estimate of Rwl is available along with the desired profit factor.

How to select the proper profit target and stop-loss values?

DLPAL discovers strategies formed by market price action, not some strategies one would like to see formed. Profit targets and stop-loss levels should be set at reasonable levels and outside of the daily or intraday volatility range. If the exits are set too low, then stops are hit very frequently and the program cannot find profitable strategies.  It takes some parameter adjusting to get to the point of identifying strategies successfully. That’s exactly the reason the DLPAL program was developed as a development tool.
It is best to first try setting exits with a ratio of profit target to stop-loss of one. In the same T/S file you may include smaller and higher ratios and notice the results. For example, in the case of T-Bond futures, you may set the profit target and stop-loss both equal to 1.00 ($1,000 per contract) but also include the pairs (1.5 , 1) and (1, 0.5). This is easily done in the same T/S file. In the case of stocks, you may want to try sets like (2%, 2%), (3%, 2%) and (5%, 3%) for example. When the search completes, you may select those strategies that better reflect your trading style.

In the case where points are used instead of percentage, for long positions, a constant number is added to the entry price to determine the profit target exit price and a constant number is subtracted from the entry price to determine the stop-loss exit price.

Case 1: The entries in the T/S file are determined based on a number of ticks:

The formula in this case for the calculation of the correct entries in the T/S file is:  T/S = (number of ticks x tick value) / Full point value

Examples: In the case of bond futures a full point is $1000, the tick value is $31.25 and  for 3 ticks target and stop the formula gives T/S = (3 x 31.25)/1000 = 0.09375. If the stop must be set to 4 ticks then the value to input in the T/S file is: S = (4 x 31.25)/1000 = 0.1250

In the case of the ES mini, a full point is $50, the tick value is $12.50 and for 5 ticks target and stop the formula gives T//S = (5 x 12.50)/50 = 1.25.

Case 2: The entries in the T/S are determined based on a fixed dollar amount

The formula in this case is: T/S = (profit or loss)/(full point value)

If in the ES mini case the target/stop is $62.50 then the formula gives:  T/S = 62.5/50 = 1.25. For the bond futures for $250 target and $125 stop the formula gives: T = 250/1000 = 0.25 and S = 125/1000 = 0.125.

The formulas in both cases (1) and (2) assume that the prices used correspond to the full point values definition, i.e. that an increment of 1.00 in the price corresponds to a full point.

Are commissions and slippage included in the search for price strategies?

Commissions and slippage are not included in the search for price strategies since the program deals only with strategy formations and their number of occurrences rather than with equity performance, which is something that depends on many factors some controllable and some random. If the profit factor is sufficiently high (see the help file section on the Profitability Calculator), the impact of commissions and slippage on profitability is minimal. Note that the strategies will form whether or not commission or slippage is considered. These parameters have more to do with the equity performance of the strategies rather than with their presence in historical data. DLPAL can generate code for popular backtesting platforms and you can test the performance of the price strategies with commission and slippage added. When backtesting single strategies and systems of strategies in DLPAL you can specify commission per share/contract, big point value and initial capital.

Data FAQ

Can I use Tradestation data with DLPAL?

There are 2 steps involved in converting daily 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.

For Tradestation 5 or earlier version:

For daily data:

Step 1: Create a text file using TS data server by outputting the fields DATE, OPEN, HIGH, CLOSE, LOW. Then, use your editor, for example, Wordpad, to determine the exact format of the file generated by TS and remove any data header if present.

Step 2: Convert the TS text file to DLPAL format using the conversion Tools. 

– From the main program menu select Tools and then Data file Conversion.
– Select the source file and specify the correct file settings.
– In the target file settings leave the default DLPAL format and hit Convert. 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.

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.

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.

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.

 

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. 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 or scan 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 and spikes. 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?

This 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

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.

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, like in the Scan function operation.

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.

Disclaimer