|
An Introduction to PAL
Price Action Lab Manual
Introduction
Price Action Lab is a software program that analyzes market price action based on user-defined performance statistics and risk/reward parameters and achieves that by searching historical daily or intraday data in a fully automated way. The program offers three main functions: (1) Search for price patterns, (2) Scan for price patterns, (3) P-Indicator calculations. Function (1) can be used to search for price patterns in historical data. The results can be grouped to form trading systems and added to the system tracking module of the program for monitoring signal generation. Alternatively, the program can generate code for a variety of trading platforms so that the price patterns can be implemented as indicators or trading systems. When this function is used, Price Action Lab serves as a system that discovers trading systems automatically. Beginning with v3.0, the search function can be used to search for patterns in each historical data file from a group of files that are also profitable in the remaining historical data files. Function (2) can be used as a scanner to determine whether there are any patterns that fulfill the user-defined criteria as of the close of the most recent bar. The difference between functions (1) and (2) is that (1) finds all patterns that fulfill the user-defined criteria, provided that the last occurrence falls within a range of bars counted starting from the most recent bar and specified by the user, whereas function (2) scans only for patterns that have a occurrence right at the most recent bar. Function (3) calculates the values of the p-Indicator, which is the most advanced technical analysis indicators ever developed. Its values can be used as an indication of the probability of the direction of short-term moves. In all three main functions, one can use multiple symbols with multiple parameters for maximum flexibility and power.
Price Action Lab can generate EasyLanguage, Metastock, Wealth-Lab 4, TeleChart, NinjaTrader, MetaTrader and Amibroker code. Users nay then combine the code with other indicators and advanced strategies in those platforms.
Price Action Lab has evolved from a pattern search program originally developed by Michael Harris, a well-known trader, trading system developer and author. The most important new feature added to Price Action Lab is a modification of the pattern search algorithm that results in higher probability for improved out_of_sample performance. Version 1.0 of Price Action Lab was released during summer 2010. Version 2.0 of Price Action Lab was released during April 2011. Major addition to v2.0: Raw code generation
Raw code is generated and saved automatically in a text file. Each line of the file contains the following:
Pattern Code;File;Type;TradeOn,Target;Stop;C
where File is the filename, Type is LONG OR SHORT, TradeOn is Open or Close, Target is the profit target, stop is the stop-loss and C is % or pts. Pattern Code is the formula code used by the native language of the various supported platforms.
The raw code generation applies only to the Search and Database results. Two files with identical content are saved automatically in sub-directory Results:
(1) A file called GeneratedCode.txt which is overwritten every time new code is generated.
(2) A file with the name: RawCode_mm_dd_yyyy_hh_mm.txt
This file is overwritten only if new code generation takes place during the same minute mm that the file was initially generated.
The text files containing raw code can be deleted using a new tool added to File Maintenance under Results and called "Code .TXT FILES".
Minor enhancements and bug fixes:
This version has two minor bug fixes in the pseudo code generation for short patterns with next close entry and in generated code labels for short patterns.
The minor enhancements include a fix for the problem with the code generation cursor jumping at the beginning of the buffer, a faster screen refresh after maximizing the application from minimized status, the disabling of the Run button on all workspaces after it is clicked and allowance of a five digit number for the Search Depth.
Beginning with this version, Metastock code generation now includes the delay value and thus the delay in the tester should be set to 1 for Open and 0 for the close.
Price Action Lab v2.5 was released on 11/08/2011. Major additions:
(1) Ability to change target and stop values in backtesting mode. The same target/stop type is asusmed, inc, pts or NC. Using this new function the sensitivity of the pattern performance to changing target/stop can be studied without generating code and backtesting in another platform.
(2) Ability to scan for 3,4,5,6 - Bar patterns only (scan function).
Minor bug fix: Fixed the Ninja code generation letter case for O,H,L,C. (MetaTrader code can be used in v2.0 instead).
Price Action Lab v3.0 was released during December of 2011. Major addition: Search from common patterns.
The search function can be used to search for patterns in each historical data file specified on a search workspace that are also profitable in all the other historical data files listed on the same workspace. This is a unique feature that provides the ultimate cross-validation method for making sure that patterns are profitable across a number of marketsand instruments.
Minor addition: Number of distinct patterns and number of files used are now shown on the heading of search and scan results.
Top
PAL FAQs
PAL FAQ
Is PAL a neural net program?
PAL is not a neural net program. It is more of a "data mining" program based on algorithms and the theory for discovering price patterns developed by Michael Harris, which is described in detailed in his books.
Where can I read about the theory of PAL?
The theory behind PAL is described in chapters 8 and 9 of the book "Short-term Trading with Price Patterns" and in more detail in the book "Stock Trading Techniques Based on Price Patterns", both by Michael Harris. But it should suffice reading the introduction of the manual to understand how PAL works, in general. The full manual is also included with the demo. Please keep in mind that although a general description of PAL is offered in the books and in the manual, the details of the program are kept proprietary. The algorithms running in the background of PAL are very complex and the process not easy to understand unless one is familiar with data mining techniques. But for most users the details are of no interest as long as they get the patterns they are looking for.
If everyone uses PAL will that affect the pattern performance?
There are so many different markets, so many different patterns and so many different ways traders can approach pattern trading (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 pattern discovered by PAL particular to a certain market?
Although with PAL you can discover pattern particular to a certain stock or futures contract, it turns out that many of those patterns work for a group of stocks or even future contracts
Are the patterns found by PAL preprogrammed in a database?
There are no hard coded patterns in PAL. Instead, PAL uses algorithmic "data mining" guided by a set of 100 (extended search option) general pattern groups. The 100 general pattern groups are not exact patterns but in a sense supersets of sets that have members thousands of possible exact pattern formations. The groups have been selected after extensive statistical studies so that they produce patterns found in price action that minimize randomness, "selection bias" and increase statistical significance. PAL does not look for traditional chart patterns but for price patterns. Some of the price patterns the program finds may look similar to traditional chart patterns. All price patterns have up to 6 price bars in their formation. That does not include the delay bars used in the delay pattern option. The program finds price patterns 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 patterns work for a group of securities.Can PAL consider volume or other indicators in the search for patterns? PAL discovers price patterns that fulfill user-defined risk/reward and performance criteria. The patterns do not consider volume information, only the open, high, low and close of price bars. The user can add volume information to the logic of the discovered patterns and test their performance in Tradestation, Metastock or Wealth-lab, as well as, combine the patterns with other indicators and technical analysis methods.
Are price patterns "curve-fitted" to the data?
The term "curve fitting" applies when parameters are adjusted (or optimized) so that a specific function "fits" a time series in a certain "best" sense, like for example minimizing ordinary least squares (displacements of points from the curve) or minimizing total least squares (the orthogonal distance to the curve). This mathematical explanation turns out to be a little illusive when it comes to trading systems. In the context of trading system design there are at least three major notions of curve-fitting determined according to the rule that curve-fitting adversely affects the actual performance of a trading system if it involves adjustment of parameters that have the greatest impact on it. It is also very important to take into consideration the timeframes involved:
(1) Entry-Exit point fitting: Parameters are adjusted to fit the entry points to a price time series. If the exit points are also affected this turns out to be the most serious type of fitting and it is unlikely that any trading system will maintain historical performance other then by pure chance. (2) Entry point fitting: Parameters are adjusted to fit the entry points to a price time series. If the exit points are not affected this turns out to be a less serious case of curve fitting for a class of trading system with performance that depends mostly on the timing of the exit points. This class includes long-term trend following systems where the timing of the entry signal is not as important as that of the exit signal. (3) Exit point curve fitting: Parameters are adjusted to fit the exit points to a price time series. If the entry points are not affected this turns out to be a less serious case of curve fitting for a class of trading system with performance that depends mostly on the timing of the entry points. This class includes certain types of intraday, short-term position and swing trading systems.
The price patterns discovered by PAL belong to the last case (3) above. These patterns are actual and exact formations that are present in the data. It is not possible to change the timing of the entry signals of a specific price pattern simply because there are no parameters to adjust for doing it. Only the exit point can be changed. In the case of price patterns, however, there is another problems related to mean reversion and selection bias. Some patterns will not stay profitable in out_of_sample testing. Other patterns will revert to zero mean returns. The objective should be to try to identify formations that have a high probability of staying profitable in the future. People use various criteria in their selection process. Price Action Lab is only a tool for discovering the patterns. PAL patterns in certain cases have been shown to have stayed profitable for several years. Read this article for specific examples.
How do I go about developing advanced strategies based on price patterns?
Many sophisticated users of PAL do not rely on signals from individual patterns but instead develop strategies based on the concepts described in the "Tips for Advanced Users" section of the help file.
For example, some users require that two or more patterns generate signals at the same time. Some others consider as signals those that come one or two bars after another signal. There are all sorts of ways and methods to try to increase the probability of success of individual pattern formations.
Can I use PAL with intraday or tick data?
PAL can be used to find patterns in intraday data after data files are properly converted to the program intraday format. Finding statistically significant patterns in very fast timeframes, like for example 1 - 10 minute bars, may turn out to be very hard or even impossible due to the presence of noise and the demand for very large samples. There are also several parameters that can affect the performance of patterns in out_of_sample backtesting or actual trading. including the target/stop ratio and short-term volatility.
Tick is not recommended since the Open, High, Low and Close have the same value. Also, it is unlikely that tick data patterns can have only statistical significance at all.
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 price patterns. The value of the p-Indicator is calculated as the ratio of the sum of the success rate P of each pattern 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 patterns. Thus, 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 patterns with long signals is considered and in the short part that of patterns with short signals.
More information about the p-Indicator can be found here and in the book Stock Trading Techniques Based on Price Patterns, pp. 100 - 107.
Top
An introduction to price patterns
A brief introduction to price patterns
Definition: A price pattern is a geometric formation of a number of bars on a chart.

Figure 1.
Three consecutive bars labeled 0, 1 and 2 form the price pattern shown in figure 1. The most recent bar in the formation, bar 0, is also called "today". Bar 1 is called "yesterday" and bar 2 is called "2 days ago", and so on.
Each bar has an Open, a High, a Low and a Close price. In the example above, it is easy to see that the close of the last bar, or close of today, is higher than the high of bar 2, or the high of 2 days ago. This may be expressed as:
Close of today > High of 2 days ago
Using the same reasoning one may notice that:
Close of 2 days ago > High of yesterday
If the same reasoning is followed, a complete description of the price pattern shown above is obtained:
High of today > Close of today AND High of 2 days ago > Close of 2 days ago AND Open of today > Low of today AND Close of today > High of 2 days ago AND High of yesterday > Open of yesterday AND Low of today > Open of 2 days ago AND Open of 2 days ago > Low of 2 days ago AND Close of yesterday > Low of yesterday AND Open of yesterday > Open of today AND Close of 2 days ago > High of yesterday AND Low of 2 days ago > Close of yesterday
The set of the eleven inequalities defines the price pattern formation shown above apart from any ambiguity. Therefore, using the above formulation it is possible to test other patterns for the possibility of matching them with the pattern shown in the example. In fact, any pattern made of three consecutive price bars is a candidate before a matching is made. If any of the inequalities in the set is not satisfied, then there is no match.
The set of inequalities defining a price pattern, as in the example above, can be combined with appropriate risk management, trade entry point, trading time frame and market selection to create a complete trading system. Here is an example:
Time frame: daily, Market: XYZ Stock If High of today > Close of today AND High of 2 days ago > Close of 2 days ago AND Open of today > Low of today AND Close of today > High of 2 days ago AND High of yesterday > Open of yesterday AND Low of today > Open of 2 days ago AND Open of 2 days ago > Low of 2 days ago AND Close of yesterday > Low of yesterday AND Open of yesterday > Open of today AND Close of 2 days ago > High of yesterday AND Low of 2 days ago > Close of yesterday then Buy tomorrow on the open 1 contract with profit target at the entry price + 2% and stop-loss at the entry price - 2%
Using the concept just illustrated, every price pattern can be coded, tested and used to generate trading signals. More information about price patterns and associated trading methodologies may be found in the reference section.
Note: when intraday data is used, "days" correspond to "bars", "yesterday" corresponds to "1 bar ago", "today" corresponds to "this bar" and "tomorrow' corresponds to "next bar".
Delay Patterns
Definition: The number of days one must wait before placing a trade after a price pattern is formed is called the Delay and the associated pattern a Delay Pattern.

Figure 2.
In figure 2 above, bars 3,4 and 5 form the price pattern and bars 2 and 1 are the delay. The trade is placed at the open of bar 0. This is exactly the same price pattern with the one shown in figure 1 above, delayed by 2 bars. In figure 1, the trade input is the open of next day (not shown), which corresponds to bar 2 in figure 2. Adding a delay of 2 bars, produces a signal at the open of bar 0.
The new description of the price pattern with the delay added is then:
High of 3 day ago > Close of 3 days ago AND High of 5 days ago > Close of 5 days ago AND Open of 3 days ago > Low of 3 days ago AND Close of 3 days ago > High of 5 days ago AND High of 4 days ago > Open of 4 days ago AND Low of 3 days ago > Open of 5 days ago AND Open of 5 days ago > Low of 5 days ago AND Close of 4 days ago > Low of 4 days ago AND Open of 4 days ago > Open of 3 days ago AND Close of 5 days ago > High of 4 days ago AND Low of 5 days ago > Close of 4 days ago
In certain situations, the presence of a delay can turn a losing trade into a winning one. In the example in figure 2, if the trade were to be placed immediately following the formation of the price pattern (bars 3, 4 and 5) and at the open of the next bar (bar 2), it would turn into a open position loss by the close of bar 1, even hitting a stop-loss, depending on the price levels. Placing the trade at the open of bar 0, instead of bar 3, filters out the price correction and results in a better (lower) price for the long signal. Of course, the opposite could happen, i.e. the price could increase resulting in a worse (higher) price for a long position signal at the time the trade is executed. Therefore, any application of delay trade input must be done carefully and after a detailed analysis of the parameters involved. In the case of price patterns with delayed input, Price Action Lab determines the best value for the delay for the patterns discovered by it. For an in-depth discussion of the different types of price patterns, including Delay Patterns see the references section.
Top
An introduction to p-Indicator
An introduction to p-Indicator
In technical analysis the term indicator refers to a formula or set of conditions that can be used as an indication of price direction. Although an indicator can be as simple as a calculation of the average of the closing prices of a number of bars on a chart, in its most general form it can involve any combination of algorithms, technical analysis studies, such as chart patterns, support & resistance levels, price and volume patterns, etc. However, most popular indicators are mathematical equations that are very simple to calculate even in real-time. The MACD, RSI, DMI and ADX are examples of popular technical analysis indicators.
In essence, every trading system is some kind of an indicator. When one combines two moving averages, a fast and a slow, the resulting moving average crossover trading system can be considered an indicator. This indicator can be programmed in the form of a function F(n,f,s) that returns +1 when the fast moving average crosses to the upside, -1 when it crosses to the downside and 0 everywhere else. In this example, n is the current bar count, f is the fast moving average period and s the slow moving average period. For example, if F(0,5,30) = 1 then this can be taken to indicate an upward price move. It is important to understand that any signals obtained from indicators have probability equal to 1 because the conditions that trigger have already happened. Any event that has already occurred has probability equal to 1. This is just one reason most indicators are not useful in trading without further analysis. In the example of the moving average crossover, if the function returns a value of -1, this means that the fast moving average has just crossed the slow one to the downside. This is an event that has already happened and has probability equal to 1.
Many traders not familiar with this fundamental axiom of Probability theory, i.e. the axiom that P(á) = 1 when á is the certain event, try to use indicators for the purpose of market timing. However, no indicator can be useful and profitable unless it indicates the market direction with a sufficiently high rate of success. The minimum rate of success that it must have depends on the risk/reward parameters employed. Use of indicators without knowledge of specific risk/reward parameters can only lead to random trading. For example, going long when the RSI value is lower than 30 is an action that is based on certain events that generated the value of 30 but tells nothing about the probability of success of a trade (see Gambler's fallacy). In order to get a measure of that probability, technical traders perform backtests of the indicator with specific risk/reward parameters that establish exit price levels for the trades signaled by an indicator value. If the generated sample of trades is sufficiently large, the success rate can be considered as a measure of the probability of a signal to generate a profitable trade for the specific risk/reward parameters.
Therefore, indicators without an associated success rate mean little and although this is understood by those who are familiar with the axioms of probability theory, many traders still use them in a discretionary way for market timing, with limited or no success potential of course. However, there is a large class of technical traders who understand the significance of a prior probability and will not use any indicator unless it fits within the context of a well-tested strategy. These traders have an edge over those who base trading decision on arbitrary and untested indicator values.
To summarize, an indicator is useful in trading when it is combined with specific risk/reward parameters in such a way as to make it possible to obtain a measure of the probability of success of trading signals and its statistical significance.
The p-Indicator
The motivation behind the development of the p-Indicator was to design a trading indicator for intraday and short-term trading which indicates the probability of success of either long or short positions at any given point in time. According to the discussion in the introduction of this paper, this requirement implied that the p- indicator value should be equal to a success rate of some type of a trading strategy. This further implied that the p-indicator calculation would require a sufficient sample of historical trades and thus a sufficiently long price history. It is also understood that this requirement would be met only if specific risk/reward parameters were used for its calculation. Therefore, the p-Indicator differs from traditional indicators in two important aspects:
(1) The p-indicator calculation at any given point depends on the price history of a security (2) The p-Indicator calculation depends on user-defined trade exit levels.
In addition:
(3) The p-indicator is based on price patterns (pure price action with no optimization applied) (4) The p-indicator is an oscillator and its value lies in the range 0 to 100%.
Definitions:
i= 1,...,N is the number of patterns considered PLi is the success rate of each pattern with a long signal. PSi is the success rate of each pattern with a short signal Ti is the number of historical trades P-long is the p-Indicator value for long positions and P-short is the value for short positions
Formulas:
P-long = 100 x Sum[i = 1,N](PLi x Ti)/Sum[i=1,N]Ti P-short = 100 x Sum[i = 1,N](PSi x Ti)/Sum[i=1,N]Ti
Thus, in the formula of the p-Indicator the success rates PLi and PSi of each of the N price patterns is weighted by the corresponding number of historical trades and then the sum is divided by the total number of trades. The p-indicator values P-long and Pshort range between 0 and 100%. The trigger levels for long and short positions are:
Long signal when: P-long - P-short > L Short signal when: P-short - P-long > S
Where L and S are positive numbers and should be greater than the level of winning bias desired. For example, if L = 10, then this is equivalent to having a winning bias of 10% (60% success rate in using the indicator). The higher these numbers are set the less frequent will be the values that trigger a position.
In addition to P-long and P-short values, one could use a measure of their statistical significance in order to avoid cases where the trade sample is not large enough. Such a significance measure is implemented in Price Action Lab. When using the p-Indicator, trades should have the same risk/reward parameters as those used in the calculation of the specific indicator value.
Implementation of the p-Indicator in Price Action Lab
The p-Indicator is implemented so that the user can get values of P-long and P-short for any combination of symbols and risk/reward parameters using just a single workspace. The calculation is based on 10 price patterns groups (N= 10) that were selected as best indicators of price action. The selection of the patterns groups is a crucial step and it was based on more than 15 years of experience in applying the indicator to trade futures, stocks and forex.
In addition, a measure of significance S is calculated for each pair of values, P-long and P-short. The algorithm for the calculation of the p-Indicator and its significance is proprietary but it is essentially based on the equations presented earlier. The user can specify the risk/reward parameters either as a percentage of the entry price or as a number of points added to the entry price of each trade generated by the price patterns. Also, exit at the next close is supported so that each trade generated by a price pattern exits at the next close.
Top
Software limitations
Software limitations
Like any software developed, Price Action Lab has limitations:
- The program can read only ASCII text files. - The pattern search is limited to a set of 100 general pattern groups (not price patterns). However, these 100 general groups cover tens of thousands of actual price pattern formations that can be found in historical price data. - The back-testing algorithm calculates a limited number of performance parameters. - The system tracking function does not keep a log of the trading signals generated.
We are working on some of the above limitations as improvements for future versions. If you have any suggestions for any additions or enhancements to the program you may contact us using the appropriate e-mail address listed in our website: http://www.priceactionlab.com
Top
Data format and sources
Data format specifications
Price Action Lab can read ASCII files with .txt or .asc extension. The data must be in ascending order so that the first line in the file has the oldest date.
The data fields can be single-spaced, comma or semicolon delimited and have the following order:
Date Open High Low Close
with the date in YYYYMMDD format (example, 20020415). In the case of intraday data, an 8-digit increasing integer index must be used in the place of the Date field [example: index starts at 10000001] and no time field is allowed.
The following is part of a valid daily data file with single space delimited fields:
20020927 30.69 30.72 25.25 26.63 20020928 26.38 30.25 25.59 29.88 20020929 29.19 29.63 27.63 27.94 20021002 28 28.19 25.03 25.25 20021003 25.88 26.13 23 23.25 20021004 22.88 24.81 21.81 24.31 20021005 23.88 24.38 20.38 21.5 20021006 20.94 22.5 18.3 20.81
The following is part of a valid daily data file with comma delimited fields:
20050321,434.50,434.60,429.20,431.40 20050322,431.00,432.80,430.80,431.60 20050323,425.00,428.40,424.50,425.40 20050324,425.50,426.50,424.30,424.80 20050328,425.00,426.20,423.40,426.00 20050329,426.50,426.60,425.90,426.00 20050330,426.20,428.00,426.00,426.90 20050331,430.30,431.40,429.70,431.10 20050401,429.70,431.50,427.10,428.30
The following is part of a valid intraday data file with each line showing the open, high, low and close of a time period (5, 15, 30 minutes, etc.). The time field is not included in the file when converting intraday data to this format:
10002824 1338.00 1338.00 1338.00 1338.00 10002825 1338.00 1338.50 1338.00 1338.50 10002826 1338.50 1339.00 1338.50 1339.00 10002827 1338.50 1338.50 1338.50 1338.50 10002828 1338.50 1338.75 1338.50 1338.75 10002829 1338.25 1338.25 1338.25 1338.25 10002830 1338.50 1338.50 1338.50 1338.50
The following is part of a valid daily data file with semicolondelimited fields:
20050211;37.03;37.85;36.93;37.7 20050214;37.7;37.94;37.69;37.87 20050215;37.9;38.48;37.82;38.12 20050216;38.03;38.16;37.83;37.98 20050217;38.05;38.14;37.43;37.47 20050218;37.48;37.57;37.26;37.35 20050222;37.03;37.55;36.79;36.89 20050223;37.04;37.07;36.7;36.94 20050224;36.85;37.44;36.76;37.41
Three tools for converting daily and intraday ASCII text files between popular formats are provided in the Tools option of the main menu

Sample data files are included in the program setup. You may use a simple text editor like Wordpad to open those files and view the format.
There are several data vendors that offer software with the capability of downloading and automatically updating data files in the format required by Price Action Lab. For more information and a list of data vendors look at the support section of our website or contact us. URL: http://www.priceactionlab.com
Note: At least 10 years of daily data or 15,000 bars of intraday data is recommended for discovering statistically significant patterns. The more data that is available, the better it is in principle.
A rule of thumb for determining the minimum number of bars for intraday pattern search is the following:
Nbars = 3,000 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
Besides the number of bars a file should contain so that statistical significance is achieved, the minimum number of trades for the search or scan should be adjusted to reflect the impact of the timeframe chosen. A rule of thumb is as follows:
Ntrades = 20 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 Ntrades = 130
In addition, one should make sure that in the selected time period in the historical data file there are significant up and down trends so that a good mix of long and short patterns is obtained. Again, these are empirical guidelines and better rules can be determined through experience.
Top
Data Conversion FAQs
Data Conversion FAQ
Can I use Tradestation data with PAL?
There are 2 steps involved in converting daily or intraday Tradestation data to files that can be used with PAL:
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 PAL:
- 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 PAL (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 PAL 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.
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 PAL 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 PAL 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.
For intraday data:
Step 1: Use the TS data server to generate an ASCII intraday text file with the option to output the following fields only: Date, time, open, high, low, close. Then, remove the file header using your editor (the first line in the file with the field names) and then use the Intraday File Creation option from the Tools menu to convert that to an intraday file. In that case, the date will be replaced by an increasing integer number and the time will be omitted.
Step 2: Convert the TS text file to PAL format using the conversion Tools.
- From the main program menu select Tools and then Intraday File Creation. - Select the source file and specify the correct file settings (mm/dd/yyyy and comma). - 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.
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.)
How to convert TeleChart daily data to PAL format?
In order to generate data for Price Action Lab from TeleChart, follow the procedure below:
1. Create a watchlist with the symbols you like to export or use a TeleChart list, like NASDAQ 100, for example 2. Go to Databank | Export to Text 3. Choose the Watchlist to export. 4. Choose the data fields to export. They must be DATE in YYYYMMDD format, OPEN,HIGH, LOW and CLOSE, in that order. 5. The delimiter must be set to "space" 6. Choose to export each each ticker in its own file. 7. Specify the directory to export the data. You may use the default C:FilesAction Labor any other directory you like. (ex. C:) 8. Choose Ascending order 9. Choose the number of days to esxport (anything above 2500 is recommended). 10. Click on Export.
Does Price Action Lab have an interface to eSignal data?
Price Action Lab doesn't interface directly with eSignal but there is a small program Qcollector, very inexpensive, that converts eSignal data to PAL 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 PAL 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 PAL directly. You must use the Intraday File Creation tool from Tools menu to convert the file to PAL 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 is the procedure for generating files in Price Action Lab (PAL) format with the Pinnacle data DMAKER?
DMAKER uses a set of command files to output the data in text or Metastock files. Those files start with an "$" sign and there are some default files available with the program, one is called $CLCLONG.asc.You have the choice of either creating your own custom file, (ex. $custom.asc), to include just the contracts you follow, or modify the existing $CLCLONG.asc to create ASCII files in PAL format. You only have to specify the conversion parameters in the first contract as in the following example:
.ASC #STARTING DATE = 01/01/1990 #ENDING DATE = 12/31/2049 #OUTPUT DATE FORMAT = 3 #OUTPUT COLUMN HEADINGS = N #COL HEADINGS IN QUOTES = N #INCLUDE HOLIDAYS = N #VALUE OF INCLUDED HOLIDAY = P #COL SEPARATOR CHARACTER = S #SAMPLING PERIOD = D #OVERWRITE OUTPUT FILE = Y #COT INTERPOLATION METHOD = 2 #COT INDEX LOOKBACK DAYS = 400 #FIRST LINE TITLE = #CLC LINKING METHOD = 3 #CLC NEG PRICE HANDLING = 5 #IDX INTERPOLATION METHOD = 2 #IDX INCLUDE SAT TRADING = Y #OUTPUT FORMAT = A BP_CLC 1,2,3,4,6,7
.ASC CC_CLC 1,2,3,4,6,7
.ASC KC_CLC 1,2,3,4,6,7
.ASC HG_CLC 1,2,3,4,6,7
_.ASC C__CLC 1,2,3,4,6,7
etc.
---------------------------
You may specify the starting date according to your requirements. Please note that in the past contracts that started after the starting date had zeros outputted for all dates before that. This can be corrected by creating a different $...asc files for those contracts. Pinnacle data will update your ASCII files after each download. Just as a reminder, make sure to run DMAKER often to take care of contract rollovers. To add a new $file to dmaker, go to the pinnacle directory and you will find a file called dmlist.dat. Edit that file and after the last line in the *CLC section add the name of the new file and then under that the file name (without the ASC extension).
How to convert QP3 data by Quotes Plus to PAL Format?
1. Run QP3 (c:filesPlus) to get the main program chart display. 2. From the main menu select: Options and then Search for Symbol (or just type N) 3. Select the files you would like to put in a list or lists. Make sure you specify in continuous contracts for commodities and the appropriate linking method when selecting the symbols from the list (volume 1 is recommended). 4. After the list is created from the main menu select Tools and then ASCII Export. 5. Create the new format (this step must be done just once) [Date(CCYYMMDD), Open, High, Low, Close)] and save it. 6. Click Export to ASCII and specify the name of the list of symbols to export and the target directory to save the files. The file extension must be set to TXT and yu must mark “Send to individual files” in Export Type option. 7. Choose the ASCII format and then click Export.
What are the steps for converting data from excel to PAL 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 PAL format using the conversion Tools from the main menu:
For daily data the procedure is as follows:
- From the main PAL 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 PAL 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 PAL 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 PAL?
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
PAL 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 PAL intraday file:
1. Use a script to output the data in text file in a format that can be converted to PAL format. Output the date, time, open, high, low, close separated by a comma. Then use the Intraday File Creation tool from the PAL main menu to convert the file to PAL 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 PAL main menu.
You can use the text files generated by NinjaTrader in PAL to search or scan for patterns and for running the p-Indicator.
Can I use data from MetaTrader with PAL?
You can use the ascii text files exported from MetaTrader to search for patterns with PAL but you must first delete the header line, save the file in .txt format and then convert it to PAL compatible format. Note that both daily and intraday data exported from MetaTrader are converted by PAL as intraday data but that makes no difference to the search. The complete steps to export data from MetaTrader and convert it to PAL 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 PAL format
(1) From the main PAL 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 PAL to search or scan for daily or intraday patterns. 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.
Top
Reporting problems
Reporting problems
To report any problems with the software e-mail technical support. For the proper e-mail address to use check our website:
http://www.priceactionlab.com
Include your name, user name and date of purchase with your e-mail.
Suggestions for improvements or additions to the software are always welcome.
Top
Workspace FAQ
Workspace FAQ
What is the difference between the search, the scan and system tracking functions?
The search function is used to discover price patterns that fulfill the performance criteria specified on a search workspace, including the minimum number of past trades, the minimum percent profitability and the maximum number of consecutive losers. This function is suitable for building trading systems and saving them in System Tracking for signal generation.
The scan function determines if there are patterns formed as of the close of the last trading day that fulfill the performance criteria specified on the scan workspace. This function is useful especially to equity traders in scanning a universe of securities like the S&P 500, for instance.
System Tracking determines which patterns in a saved trading 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.
The main difference between system tracking and the scan function is that patterns may show up during a scan which may not be present in a trading system saved after running a search. Also, the scan uses only the open of next day for trade input.
How to determine the minimum % profitability to use?
The formula for the minimum profitability P (for a derivation see Michael Harris' book ) is: P = 100/(1+ Rwl)
where Rwl is the ratio of average winner to average loser and can be approximated by the ratio of profit target to stop loss, for fixed dollar size trades. 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) (also given in the book)
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)
PAL 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?
PAL discovers patterns formed by market price action, not some patterns 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 patterns. It takes some parameter adjusting to get to the point of identifying patterns successfully. That's exactly the reason the PAL program was developed in the first place: to facilitate the search process.
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, set the profit target and stop-loss both equal to 1.00 ($1,000 per contract) but also include the sets (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 (7%, 7%), (5%, 4%) and (10%, 6%) as examples. When the search completes, select those patterns 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 minin, 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.
What does the option "Search Depth" mean?
PAL searches for patterns in the historical data starting from the most recent bar in the Search Range. The default Search Depth is 500 bars. Changing this parameter impacts the time taken to complete the search. A minimum of 250 bars is recommended and this will detect all patterns with at least one trade in the most recent 250 bars. Note that this parameter is not related to the back-testing range used during the search, which considers the full price history available. This parameter defines the number of recent bars in the historical data file where each pattern reported in the results must have at least one trade.
What is the "Include Patterns with Equal Values" option mean?
The "Include Pattern with Equal values" option when checked instructs the program to search for patterns having equal parameters in their logic (for example: High of yesterday = high of today). Checking this option just increases the potential candidates for patterns. Some traders do not like patterns with equal parameters and we included that as an option.
Are commissions and slippage included in the search for price patterns?
Commissions and slippage are not included since the program deals only with pattern formations and their number of occurrences rather than with equity performance, which is something that depends on many factors some controllable and other totally random.. Also, including commissions and slippage can result in some form of undesirable optimization. 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 price patterns will form whether or not commission or slippage is considered. These parameters have more to do with the equity performance of the patterns rather than with their presence in historical data. PAL can generate code for popular trading software like Tradestation, Metastock and Wealth-lab and you can test the performance of the price patterns with commission and slippage added.
Top
Tips for quick start
Tips for quick start
In order to use Price Action Lab to search for patterns you need to specify the following on a search workspace:
1. A data file of the price history to use in the search for price patterns. The file must have appropriate format and length.
2. The minimum performance of the price patterns and risk/reward objectives to apply.
The software setup includes sample historical daily and intraday data files in compatible format. These files are located in the DATA subdirectory of the program.
Sample search and scan workspaces are also included in the MYWORK subdirectory. You may open the workspaces and view the parameters specified in them. Results are also included. in RESULTS subdirectory.
The following two steps are required in order to run a search: for price patterns
1. Create a T/S file
This file contains the profit target and stop-loss values to be applied to the search. Each line in a T/S file corresponds to a pair of profit target and stop-loss values used in the back-testing of price patterns for determining historical performance. The values in a T/S file may stand for percentages of the entry price or points added to the entry price and the choice between the two options is made on the search workspace. Sample files can be found in the TRS subdirectory.
2 Create a search workspace
In the workspace you specify the T/S file to use, the historical data file and the trade input and search parameters. Note: If the option to search for common patterns is selected, all data files on the workspace must have the same point value in the case point stops are used.
The following two steps are required to set-up a price pattern scan:
1. Create a T/S file
This file contains the profit target and stop-loss values to be applied to the scan. Each line in a T/S file corresponds to a pair of profit target and stop-loss values used in the back-testing of price patterns for determining historical performance. The values in a T/S file may stand for percentages of the entry price or points added to the entry price and the choice between the two options is made on the scan workspace. In the case of exits on the close of the next bar, the values of the T/S file are not taken into account and can be set to anything. Sample files can be found in the TRS subdirectory.
2 Create a scan workspace
In the workspace you specify the T/S file to use, the historical data file and the trade input and scan parameters. Note: in the case that next close (NC) is selected as the exit parameter on a scan workspace, a dummy T/S file must be specified with just one pair of target/stop values but these will not be used by the program.
The following two steps are required to set-up p-Indicator calculations
1. Create a T/S file
This file contains the profit target and stop-loss values to be applied to the calculations. Each line in a T/S file corresponds to a pair of profit target and stop-loss values used in the back-testing of price patterns for determining historical performance. The values in a T/S file may stand for percentages of the entry price or points added to the entry price and the choice between the two options is made on the workspace. In the case of exits on the close of the next bar, the values of the T/S file are not taken into account and can be set to anything. Sample files can be found in the TRS subdirectory.
2 Create a p-Indicator workspace
In the workspace you specify the T/S file to use, the historical data file and the trade input parameters. Note: If next close (NC) is selected as the exit parameter, a dummy T/S file must be specified with just one pair of target/stop values but these will not be used by the program.
When creating a search, scan or p-Indicator workspace you may introduce multiple search, scan or p-Indicator lines each with different data file(s), T/S file and parameters.
FAQ
What is the difference between the search and the scan functions ?
The search function discovers all price patterns that satisfy the performance criteria specified on the search workspace, such as a minimum number of trades, a minimum percent profitability (success rate), a minimum profit factor and a maximum number of consecutive losers. The results of this function can be used for grouping patterns into trading systems and storing them in System Tracking for signal generation or for generating code for use with popular trading platforms.
The scan function determines if there are patterns formed as of the close of the last bar in the data file that satisfy the performance criteria specified on the scan workspace. This function is especially useful for scanning a universe of securities, like for example the S&P 500 stocks, or a number of futures contracts. A scan is equivalent to a search with the Search Depth parameter set equal to 1 bar. The scan function can be used to discover new price patterns on a daily basis to add to the database or System Tracking.
Using the search function to discover trading systems together with the scan function on a daily basis for determining the presence of new patterns is the recommended use of the program. As an example, one can use the search function to discover a number of patterns in S&P 500 index mini futures and then add a trading system to System Tracking.. Then, on a daily basis, the updated historical data file can be used in a scan workspace to get the signals from price patterns and compare that to the System Tracking output to determine whether there are some new patterns that were not detected at the time of the search due to not satisfying the performance criteria, or to even identify any long-short signal conflicts.
Note: The best way to become familiar with a program is by actually working with it. There are many ways to use a trading program depending on user's experience and objectives and this also applies in the case of Price Action Lab.
Top
Creating a T/S file
Creating a T/S file
To Open an existing T/S file
Click T/S Files from the main menu and then click Open. Select the file from the list and click Open

To create a new T/S file
Click T/S Files and then click Create.

In the input fields under Target and Stop you may type the desired profit target and stop-loss values. The numbers inputted represent absolute values and correspond to percentages of the entry price or points added to the entry price. Note that all values in a specific T/S file must be used as the same type, percentages or points. Mixing is not allowed.
You may input as many sets of profit target T and stop-loss S values you desire. PAL will use each set separately when evaluating the historical performance of the price patterns.
When pts (points) is selected for Exit in Trade parameters then the profit target and stop-loss price are calculated as follows:
For long positions:
Profit target price = Entry price + T Stop-loss price = Entryprice - S
For short positions:
Profit target price = Entry price - T Stop-loss price = Entryprice + S
When % (percent) is selected for Exit in Trade parameters then the profit target and stop-loss price are calculated as follows:
For long positions:
Profit target price = Entry price x (1+T/100) Stop-loss price = Entryprice x (1 - S/100)
For short positions:
Profit target price = Entry price x (1-T/100) Stop-loss price = Entryprice x (1+S/100)
When NC (next close) is selected for Exit in Trade parameters then the exit price is calculated as follows:
For long or short positions:
Exit price = close of the day following pattern formation
Saving a T/S file
The T/S file created can be saved by Clicking File and then Save As. Convenient names to denote the contents of the T/S files are recommended. For instance, a file containing the value 7 for the target and stop can be named as "7" and shown by the program as "7.trs".
A short note on using targets and stops
The use of points added to the entry price for profit target and stop-loss values deserves some attention. In the case of stocks, the use of point stops is straightforward. However, use of percentages, as opposed to points is recommended in the case of stocks. Point stops are often used in conjunction with futures contracts. The appropriate values to select depend on the position of the decimal point in the ASCII data used with the program. For example, in the case of the Euro currency CME futures contract, a full point increment for profit target and stop-loss should be typed in as "1" if the data have the format of a two digit decimal (ex. 84.47 to mean 0.8447 cents per Euro). If the data has no decimal point, (ex. 8447 to mean 0.8447 USD per Euro) then 100 is the appropriate increment for a full point profit target and stop-loss. Some programs that export ASCII text files may even use a full decimal number for the particular contract example. (.8447, i.e. 0.8447 cents per Euro). In this last case, 0.01 is the appropriate value to use for a full point profit target and stop-loss. In general, it is recommended to check the ASCII data file values used before creating the T/S files. You may use an editor such as Wordpad to inspect the contents of data files in order to determine the correct values to use in T/S files.
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 E-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 (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.
Using multiple profit target/stop-loss pairs
T/S files with multiple entries for the profit target/stop-loss values can be created and saved. The program will determine the patterns that satisfy the performance parameters specified by the user for each pair in the T/S file. This can prove useful in determining the sensitivity of price patterns to various profit target/stop-loss values. Alternatively, one may create and save different T/S files with a single pair of values and multiple search or scan lines to accomplish the same task.
Top
Creating a search workspace
Creating a search workspace
To open an existing search workspace or create a new one
Click File and then click Pattern Search Workspace.

Select Open Existing Workspace and then click OK. Select a file and then click Open.

To Create a new workspace
Click File, then click Pattern Search Workspace, select Create New Workspace and click OK. Then, click on the first empty search line to start the process of parameter selection.

The following must be specified on the workspace for each separate search line:
1. T/S file 2. Data file (must have proper format) 3. Trade parameters: Exits based on percentages (%) or points (inc) of entry price, trade inputs on Open or Close and option to apply trade input delay 4. Search parameters: Minimum profitability (success rate) for long and short patterns, minimum Profit Factor (sum of winners/sum of losers) minimum number of historical trades and maximum number of consecutive losers 5. The number of most recent records in the data file, or bars, where each patterns found by the program must have at least one trade. Recommended value is the default of 500 bars for daily data. In the case of intraday data the value will depend on the timeframe.
To Select a T/S file
Select a T/S file from the appropriate directory. Click on a file to highlight it and then click the hand icon pointing down to move it in the selection field. Alternatively, you can just doubleclick a file and it will automatically get selected. To change the T/S file click the hand icon pointing up and repeat the selection process.

To Select a data file
Select a data file from the appropriate directory. Click on a file to highlight it and then click the hand icon pointing down to move it in the selection field. Alternatively, you can just doubleclick a file and it will automatically get selected. To change a data file click the hand icon pointing up and repeat the selection process.

Trade and Search Parameters
Specify the type of exits (profit target and stop-loss) to use by selecting either % for percentages of entry price or inc for points (increments) added to entry price. Specify the type of trade input by selecting either Open or Close. If Open is selected then the entry price will be the open of the bar following the completion of the pattern formation. If Close is specified, then the entry price will be the close of the bar the formation is complete.
Specify if you want to apply a delay in the trade input of price patterns. To select a delay, check the On option under Delay and specify the delay range. The default values are 1 - 5. Allowable values are 1 - 25.

Note: If you mark On for the delay and specify a range for this variable PAL will determine the best value for the delay to apply in each pattern discovered. In many cases, PAL may discover more patterns as compared to a search with no delay applied. This occurs when more patterns become profitable when a delay is applied.
Warning! Activating the delay option may slow down the search considerably. It is recommended that the default range (1-5) is used.
Specify the minimum percent profitability (success rate) for long and short position patterns by inputting the appropriate value to use in the fields. This parameter is equal to the number of winning trades divided by the total number of trades times 100. (The defaults are set to 66.00%, that is all patterns found must have profitability greater than 66%). Then, specify the minimum Profit Factor, which is equal to the sum of winning trades divided by the sum of losing trades). Next specify the minimum number of trades a pattern must generate in the historical data. (The default is 20 trades). Finally, specify the maximum number of consecutive losers that each pattern is allowed to have in the historical data, max Consecutive Losers. (Default is 3 consecutive losers per pattern and shown as "< 4").

File Data Range, Search Depth, Extended search, Find Common Patterns Only, Patterns with equal values and Default Workspace

File Date Range
As soon as a data file is selected, the date range is automatically shown in the First Date and Last Date fields. These fields cannot be changed.
The program searches for patterns in the historical data starting from the most recent bar in the Search Range. The default Search Deapth is 500 bars. Changing this parameter impacts the time taken to complete the search. A minimum of 250 bars is recommended and this will detect all patterns with at least one trade in the most recent 250 bars. Note that this parameter is not related to the back-testing range used during the search, which considers the full price history available. This parameter defines the number of recent bars in the historical data file where each pattern reported in the results must have at least one trade.
Checking the option Extended search increases the number of the general pattern groups used in the search from 20 to 100. This may increase the potential of the search significantly and result in a higher number of patterns that satisfy the criteria but the search will take much longer to complete.
Checking the option Find Common Patterns Only instructs the program to look for patterns in each instrument on the workspace that are also profitable in all other instruments. This works as follows: when the program finds a pattern in one instrument that satisfies the criteria set on the workspace for that particular case, it also backtests its performance in all other instruments using the parameters of the original instrument (target, stop, etc.). If in all cases the profit factors calculated are greater than the minimum profit factor for common patterns (defaule is 1.00) then, and only then, the pattern is reported in the results. Notes: (1) The chances of finding common patterns decreases with the number of instruments and as the Common Profit Factor value is inreased. (2) When this option is selected, all data files on the workspace must have the same point value in the case point stops are used. For example, when using currency pairs with point stops (pips), often EURUSD and USDJPY have different point values. These must be adjusted in the historical file before the search for common patterns so that a point stop of 0.01 in EURUSD ( 100 pips), for example, also corresponds to the same number of pips in USDJPY.
Checking the box Include Patterns with Equal Values instructs rhe program to include patterns having equal parameters in their formations. For instance, the High of bar 0 may be equal to the High of bar 1. This applies only to the high and low parameters of the bars. It excludes the close and the open, i.e. patterns having formations with equal values involving the open or close are omitted anyway.
You may mark a workspace as the default workspace of the program by checking the box next to Make this my default workspace.
Creating a Search Line
To create a new search line, click on the first empty search line. After file and parameter selection click on the hand icon pointing downwards. To delete a search line, click on that line and hit the DEL key, or use the hand icon pointing upwards to remove it.

Saving the workspace and Running a search
Click Save to save the workspace. Click Run or hit the F3 key to start the search.
Top
Running a search
Running a search
To start a search for patterns that satisfy the performance criteria set on a workspace, click Run after you create and save the workspace. The progress bars will indicate the progress of the search:

The first progress bar, Applying Index Group, shows the group (Index) of patterns the program is searching for at the moment and the search line number
The second progress bar, Processing Record, shows the progress of the search in the specified Search Range and the file processed
The third progress bar, Executing Target and Stop, shows which profit target and stop-loss pair is applied from the T/S file. in the relevant search line
Clicking Abort terminates the search. Any results are NOT saved in this case.
Top
Creating a Scan workspace
Creating a Scan workspace
To open an existing scan workspace or create a new one
Click File and then click Pattern Scan Workspace.

Select Open Existing Workspace and then click OK. Select a file and then click Open.

To Create a new workspace
Click File, then Pattern Scan Workspace, select Create New Workspace and click OK. Then, click on the first empty scan line to start the process of parameter selection.

The following must be specified on the workspace form for each separate search line:
1. T/S file 2. Data file(s) 3. Trade parameters: Exits based on percentages (%) of entry price, points (pts) added to entry price or Next Close (NC). Trade Inputs are the Open or Close. 4. Scan parameters: Minimum profitability (success rate) for long and short patterns, the minimum number of historical trades and the maximum number of consecutive losers (less than) 5. Pattern Length: The program can be instructed to look for 3,4,5 and 6-Bar patterns only in extended mode.
To Select a T/S file
Select a T/S file from the appropriate directory. Click on a file to highlight it and then click the hand icon pointing down to move it in the selection field. Alternatively, you can just doubleclick a file and it will automatically get selected. To change the T/S file click the hand icon pointing up and repeat the selection process. Note: in the case that next close (NC) is selected as the exit parameter, a dummy T/S file must be selected with just one pair of target/stop values but these will not be used by the program.

To Select data file(s)
Select the directory where the data files are located and mark the box next to the option Select all files, to select all files in the directory specified (default option). If this option is checked, the same T/S file, Trade and Scan parameters will apply to all data files. Note: To select a single file from a directory you must first uncheck the box next to the Select all files option and then highlight the file to scan.

Trade and Scan Parameters
Specify the type of exits (percent or points) to be used with the profit target and stop-loss values in the T/S file, or next close (NC), by selecting % for percentages of entry price, pts for points added to entry price, or NC for next close exit. Specify the type of trade input by selecting either Open or Close. If Open is selected then the entry price will be the open of the bar following the completion of the pattern formation. If Close is specified, then the entry price will be the close of the bar the formation is complete, which is the last record in the data file and also the most recent bar in the pattern formation..

Specify the minimum percent profitability for long and short position patterns by inputting the appropriate value to use in the fields. (The defaults are set to 66.00%, that is all patterns found must have profitability greater than 66%). Next specify the minimum number of trades a pattern must generate in the historical data. (The default is 20 trades). Finally, specify the maximum number of consecutive losers than each pattern is allowed to have in the historical data, max Consecutive Losers. (Default is 3 consecutive losers per pattern and shown as "< 4").

Pattern Length Selection

The program can be instructed to look for 3,4,5 and 6-Bar patterns only in extended mode. If "All Bars" is selected, then the default is the regular search unless the Extended Search option is marked.
Extended scan, Patterns with equal values and default workspace
Checking the option Extended scan increases the number of general pattern groups used in the scan from 20 to 100. This may increase the potential of the scan significantly and result in a higher number of patterns but the scan will take much longer to complete.
Checking the Include Patterns with Equal Values box will prompt the program to include patterns having equal parameters in their formations. For instance, the High of bar 0 may be equal to the High of bar 1. This applies only to the high and low parameters of the bars. It excludes the close and the open, i.e. patterns having formations with equal values involving the open or close are omitted anyway.
You may mark a workspace as the default workspace of the program by checking the box next to Make this my default workspace.

To create a new scan line, click on the first empty scan line. After file and parameter selection click on the hand icon pointing downwards. To delete a scan line, click on that line and hit the DEL key, or use the hand icon pointing upwards to remove its contents.

Saving the workspace and Running a scan
Click Save to save the workspace. Click Run or hit the F3 key to start the scan.
Top
Running a Scan
Running a Scan
To start a scan for patterns that satisfy the performance criteria set on a workspace, click Run after you create and save the workspace. The progress bars will indicate the progress of the scan:

The first progress bar, Applying Index Group, shows the group (Index) of patterns the program is scanning for at the moment and the scan line number
The second progress bar, Processing file, shows the data file scanned at the moment
The third progress bar, Executing Target and Stop, shows which profit target and stop-loss pair is applied in terms of their position in the T/S file.
Clicking Abort terminates the scan. No results are saved in this case.
Top
Creating a p-Indicator workspace
Creating a p-Indicator workspace
To open an existing p-Indicator workspace or create a new one
Click File and then click P-Indicator Workspace.

Select Open Existing Workspace and then click OK. Select a file and then click Open.

To Create a new workspace
Click File, then p-Indicator Workspace, select Create New Workspace and click OK. Then, click on the first empty scan line to start the process of parameter selection.

The following must be specified on the workspace form for each separate search line:
1. T/S file 2. Data file(s) 3. Trade parameters: Exits based on percentages (%) of entry price, points (pts) added to entry price or Next Close (NC). Trade Inputs are the Open or Close.
To Select a T/S file
Select a T/S file from the appropriate directory. Click on a file to highlight it and then click the hand icon pointing down to move it in the selection field. Alternatively, you can just doubleclick a file and it will automatically get selected. To change the T/S file click the hand icon pointing up and repeat the selection process. Note: in the case that next close (NC) is selected as the exit parameter, a dummy T/S file must be selected with just one pair of target/stop values but these will not be used by the program.

To Select data file(s)
Select the directory where the data files are located and mark the box next to the option Select all files, to select all files in the directory specified (default option). If this option is checked, the same T/S file, Trade and Scan parameters will apply to all data files. Note: To select a single file from a directory you must first uncheck the box next to the Select all files option and then highlight the file to scan.

Trade and Scan Parameters
Specify the type of exits (percent or points) to be used with the profit target and stop-loss values in the T/S file, or next close (NC), by selecting % for percentages of entry price, pts for points added to entry price, or NC for next close exit. Specify the type of trade input by selecting either Open or Close. If Open is selected then the entry price will be the open of the bar following the completion of each pattern formation in the indicator calculation. If Close is specified, then the entry price will be the close of the bar the formation is complete, which is the last record in the data file and also the most recent bar in the pattern formation..

You may mark a workspace as the default workspace of the program by checking the box next to Make this my default workspace.

To create a new p-Indicator line, click on the first empty scan line. After the file and parameter selection click on the hand icon pointing downwards. To delete a line, click on that line and hit the DEL key, or use the hand icon pointing upwards to remove its contents.

Saving the workspace and Running a scan
Click Save to save the workspace. Click Run or hit the F3 key to start the p-Indicator calculations.
Top
Running the p-Indicator calculations
Running the p-Indicator calculations
To start the p-Indicator calculations, click Run after you create and save the workspace. The progress bars will indicate the progress of the calculations:

The first progress bar, Evaluating Patterns, shows the group (Index) of patterns the program is scanning for at the moment and the scan line number
The second progress bar, Processing file, shows the data file used in the calculation
The third progress bar, Executing Target and Stop, shows which profit target and stop-loss pair is applied in terms of their position in the T/S file.
Clicking Abort terminates the p-Indicator calculation. No results are saved in this case.
Top
Search workspace results
Search workspace results
When a search is completed, the results are displayed on the screen.
In the case no patterns are found
In the case no patterns are found based on the search parameters specified, the following message is shown:

Clicking Help offers general advice on what could be done to increase the chances of finding patterns in the specific data file.

Click OK to close the popup window
In the case that patterns are found
The patterns found by the program are displayed on the results form. Each line represents a pattern and lists its characteristics.

Saving the results
To save the results click File on the main menu and then Save. You can select any number of patterns to save in a new results file. For example, you can sort the results for highest number of trades and then select only those patterns with 50 or more trades:

The new results file will look like:

Opening saved results files
To display results already saved click Results from the main program menu, then select Pattern Search Results and then Open. Open Last displays the most recent results generated by the program.

Search Results Options
The results form offers several options:

Add to Database adds all patterns found to the program database
Generate Metastock Code generates Metastock code for the patterns selected.
Generate EasyLanguage Code generates EasyLanguage code for the patterns selected
Generate Model Logic generates the model logic for the patterns selected
Generate Wealth-Lab Code generates WealthScript for the patterns selected
Generate TeleChart Code generates PCF compatible code for the patterns selected
Generate NinjaTrader Code generates condition code for NinjaTrader
Generate MetaTrader Code generates condition code for MetaTrader
Generate Amibroker Code generates condition code in Amibroker AFL
System Tracking allows defining a trading system consisting of selected patterns for monitoring signal generation
Test Patterns allows out of sample testing and diplays the new results
To select all patterns from the results click on the File Name column label on the workspace results form. To deselect all patterns click again on the File Name column label. To select specific patterns click the sign of a pattern line so it turns into the sign.
Raw code generation in a text file is available from Search Results. Each line of the file contains the following:
Pattern Code;File;Type;TradeOn,Target;Stop;C
where File is the filename, Type is LONG OR SHORT, TradeOn is Open or Close, Target is the profit target, stop is the stop-loss and C is % or pts. Pattern Code is the formula code used by the native language of the various supported platforms.
Two files with identical content are saved automatically in sub-directory Results:
(1) A file called GeneratedCode.txt which is overwritten every time new code is generated.
(2) A file with the name: RawCode_mm_dd_yyyy_hh_mm.txt
This file is overwritten only if new code generation takes place during the same minute mm that the file was initially generated.
The text files containing raw code can be deleted using a new tool added to File Maintenance under Results and called "Code .TXT FILES".
Back-testing option
To back-test a pattern select the pattern line by clicking on it and hit the F3 key or click the right mouse button and select Back-test.
Top
Scan workspace results
Scan workspace results
When a scan is completed, the results are displayed on the screen.
In the case no patterns are found
In the case no patterns are found based on the search parameters specified, the following message is shown:

Clicking Help offers general advice on what could be done to increase the chances of finding patterns in the specific data file.

Click OK to close the popup window
In the case that patterns are found
The patterns found by the program are displayed on the results form. Each line represents a pattern and lists its characteristics.

Saving the results
To save the results click File on the main menu and then Save.
Opening saved results files
To display results already saved click Results from the main program menu, then select Pattern Scan Results and then select Open. Open last displays the most recent results generated by the program.

Scan Results Options
The results form offers several options:

Add to Database adds all patterns found to the program database
Generate Metastock Code generates Metastock code for the patterns selected.
Generate EasyLanguage Code generates EasyLanguage code for the patterns selected
Generate Model Logic generates the model logic for the patterns selected
Generate Wealth-Lab Code generates WealthScript for the patterns selected
Generate TeleChart Code generates PCF compatible code for the patterns selected
Generate NinjaTrader Code generates condition code for NinjaTrader
Generate MetaTrader Code generates condition code for MetaTrader
Generate Amibroker Code generates condition code in Amibroker AFL
System Tracking allows defining a trading system consisting of selected patterns for monitoring signal generation
To select all patterns from the results click on the File Name column label on the workspace results form. To deselect all patterns Click again on the File Name column label. To select specific patterns click the sign of a pattern line so it turns into the sign.
Back-testing option
To back-test a pattern select the pattern line by clicking on it and hit the F3 key or click the right mouse button and select Back-test.
Top
Interpreting search and scan results
Interpreting the results
Each line on the search or scan results or Database results corresponds to a price pattern that satisfies the criteria specified on the search or scan workspace.
Pattern Search results Example of search results

Pattern Scan results
Example of scan results

File Name is the data file used in the search or scan
Index denotes the general group patterns belong to (1 to 100). This number is used by the program for pattern classification purposes.
Index Date is the date of the most recent occurrence of a pattern in the data file for Pattern Search results. In the case of scan results, it always coincides with the last date in the data file.
Trade on is either Open or Close and refers to the trade entry point. In the case that the Delay option was activated, these fields will show as Open(n) or Close(n) (ex. Open2, Close1). The value of n is the best delay for the specific price pattern and it is determined based on highest historical profitability.
P is the percent profitability (success rate) of patterns. P = winning trades x 100/total trades
PF is the Profit Factor (sum winners/sum losers). Shown only in search results. Profitable patterns and trading systems in general require that PF > 1.
P1 is the 1-bar percent profitability. It is calculated by dividing the number of trades that exit with profit during the first bar after entry by the total number of trades. Available only in scan results. P1 = P for NC exit, by definition.
CL is the number of maximum consecutive losers of the pattern.
Type is used in the case of Pattern Search and is either Long or Short. Signal is used in the case of Pattern Scan and is either Long or Short. Patterns with a Long type are used for taking long positions and patterns with a Short types are used for taking short positions. A Long signal in a scan indicates a pattern for taking a long position and a Short signal indicates a pattern for taking a short position.
Target shows the profit target value used in the search or scan
Stop shows the stop-loss value used in the search or scan
C indicates the type of exit applied, % stands for percentages, pts for points and NC for next close exit (scan results only). In case NC is indicated as the exit, any Target and Stop values specified in the T/S file are not used..
Last Date is the most recent date (last) in the data file
First Date is the first date (oldest) in the data file
Clicking on the column labels sorts the results by percent profitability, profit factor, consecutive losers or number of trades.
Top
p_indicator workspace results
p_indicator workspace results
When the p-Indicator calculations are completed, the results are displayed on a form.

Saving the results
To save the results click File on the main menu and then Save.
Opening saved results files
To display results already saved click Results from the main program menu, then select P-Indicator Results and then select Open. Open last displays the most recent results generated by the program.

Top
Interpreting p-Indicator results
Interpreting p-Indicator results
Each line on the p-Indicator results form corresponds to a calculation of the indicator values and their significanse for a signle data file, T/S file line entry and corresponding trade parameters.
Example of search results

File Name is the data file used in the calculation
TS is the name of the T/S file used
Trade on is either Open or Close
C indicates the type of exit applied, % stands for percentages, pts for points and NC for next close exit. In case NC is indicated as the exit, any Target and Stop values specified in the T/S file are not used..
P-long is the long value of the p-Indicator
P-short is the short value of the p-Indicator
P-delta is the result of P-long-P-short
S is the significance of the values
Last Date is the most recent date (last) in the data file
First Date is the first date (oldest) in the data file
Clicking on the column labels PIL, PIL and S sorts the results.
Interpretation and use:
The p-indicator values P-long and P-short range between 0 and 100%. The trigger levels for long and short positions are:
Long signal when: P-delta = P-long - P-short > L Short signal when: P-delta = P-long - P-short < -S
Where L and S are positive numbers and should be greater than the level of winning bias desired. For example, if L = 10, then this is equivalent to having a winning bias of 10% (60% success rate in using the indicator). The higher these numbers are set the less frequent will be the values that trigger a position.
In addition to P-long and p_short values, one could use a measure of their statistical significance S in order to avoid cases where the trade sample is not large enough. The following are recommended:
No significance: S = 0
Low significance: S < 4
Medium significance: 3 < S < 8
High Significance: 7 < S < 11
Very high significance: S > 10
When using the p-Indicator, all trades should have the same risk/.reward parameters with those used in the corresponding calculations.
Top
Database results
Database results
Patterns stored in the program database may be retrieved by clicking on Results form the main program menu and selecting Database

Select a file name from the list and click OK

A list of all patterns results by file name will display with options for generating code for the patterns and for adding selected patterns to System Tracking. You may delete all patterns linked to a certain file name by clicking on File from the main Database Results menu and then Delete File. The database may be erased completely by clicking on File and then Delete All Files.

File Name is the data file used in the search or scan
Index denotes the general group patterns belong to (1 to 100). This number is used by the program for pattern classification purposes.
Index Date is the date of the most recent occurrence of a pattern in the data file for in the case of search results. In the case of scan results, it always coincides with the last date in the data file.
Trade on is either Open or Close and refers to the trade entry point. In the case that the Delay option was activated, these fields will show as Open(n) or Close(n) (ex. Open2, Close1). The value for (n) is the best delay for the specific price pattern and it is determined based on the best historical profitability.
PS is the percent profitability (success rate) of patterns for long positions. In this case PS = 100 - PL
PS is the percent profitability of patterns for short positions. In this case PL = 100 - PS
CL is the number of maximum consecutive losers of the pattern.
Type is either Long or Short. Patterns with a Long type are used for taking long positions and Short types for taking short positions. PL is the profitability of long patterns and PS the profitability of short patterns.
Target shows the profit target value used in the search or scan
Stop shows the stop-loss value used in the search or scan
C indicates the type of exits applied, % stands for percentages, pts for points and NC for next close exit (scan results only). In case NC is indicated as the exit, any Target and Stop values specified in the T/S file are not used
Last Date is the most recent date (last) in the data file
First Date is the first date (oldest) in the data file
Clicking on the column labels sorts the results by percent profitability, consecutive losers or number of trades.
The Database results offer several options:

Generate Metastock Code generates Metastock code for the patterns selected.
Generate EasyLanguage Code generates EasyLanguage code for the patterns selected
Generate Model Logic generates the model logic for the patterns selected
Generate Wealth-Lab Code generates WealthScript for the patterns selected
Generate TeleChart Code generates PCF compatible code for the patterns selected
Generate NinjaTrader Code generates condition code for NinjaTrader
Generate MetaTrader Code generates condition code for MetaTrader
Generate Amibroker Code generates condition code in Amibroker AFL
System Tracking allows defining a trading system consisting of selected patterns for monitoring signal generation
To select all patterns from the database results click on the File Name column label on the results form. To deselect all patterns Click again on the File Name column label. To select specific patterns click the sign of a pattern line so it turns into the sign.
Raw code generation in a text file is available from Database Results. Each line of the file contains the following:
Pattern Code;File;Type;TradeOn,Target;Stop;C
where File is the filename, Type is LONG OR SHORT, TradeOn is Open or Close, Target is the profit target, stop is the stop-loss and C is % or pts. Pattern Code is the formula code used by the native language of the various supported platforms.
Two files with identical content are saved automatically in sub-directory Results:
(1) A file called GeneratedCode.txt which is overwritten every time new code is generated.
(2) A file with the name: RawCode_mm_dd_yyyy_hh_mm.txt
This file is overwritten only if new code generation takes place during the same minute mm that the file was initially generated.
The text files containing raw code can be deleted using a new tool added to File Maintenance under Results and called "Code .TXT FILES".
Top
Code results
Code results
Click on Results form the main program menu and select Code

From the drop-down list select the type of model file (Files of type:)

The following choices are available:
Model logic files
Easylanguage files
Metastock Files
Wealth-Lab Files
TeleChart Files
NinjaTrader Files
MetaTrader Files
Amibroker Files
Select a file from the list and click Open to display the saved code
Top
System Tracking results
System Tracking results
Click on Results form the main program menu and select System Tracking

Select a file and click Open
System Tracking files contain results for the models added to System Tracking.
Top
Back-testing Price Patterns
Back-testing price patterns
To back-test a pattern select the pattern line form search, scan or system tracking results by clicking on it and hit the F3 key or click the right mouse button and select Back-test.

The program extracts the information for the data file needed to perform the back-test from the results. You may change the data file to apply to a back-test by selecting a new directory where the new file can be found, provided that the name of that file is the same with that shown in the results. The back-test range is indicated on the back-test window.

Click OK to back-test. The results show details about each trade and the values of several performance parameters:

The profit-target and stop-loss can be changed when backtesting for studying the sensitivity of the pattern to various exit levels. Click "Change Target and Stop" to activate this option:

Only target and stop can be changed with this option. Trade entry choice "Trade on" and exit type C (%, pts or NC) cannot be changed.
Patterns added to trading systems in System Tracking can be back-tested by selecting the trading system from the list first, then clicking on View and following the process described above.
The back-testing function is useful for determining past entry/exit days and other useful performance parameters of patterns. As more data is added to a historical data file, the back-testing function can be used to monitor the performance of patterns previously discovered. This can be done either from the original results file or from System Tracking.
Note: the back-testing function takes into account any open position in calculating the performance parameters. The search and scan functions do not consider open positions and thus the performance parameter values may differ slightly in such case.
Top
Test Patterns
Test Patterns
In the search results example shown below, the QQQQ patterns were found using historical daily data from 20020507 to 20081231:

In order to test the patterns in out of sample data, click Test Patterns. The program will ask you to select a directory where the out of sample data files can be found by the program:

The directory is selected by doubleclicking the appropriate folder. After the directory is selected, click OK to test the patterns shown in the results using the new data: In this example, the data start date is 200901021 and the end date is 20100524:

Note that the original performance parameters are replaced with the ones that correspond to the data period selected. You can now select patterns from the results to add to system tracking or perform any other function in the exact same way as with the original results.
In this particular example, 2 patterns have a profit factor less than 1 in the out of sample period. That may be an indication that these patterns lack robustness and they should not be used in a trading system.
Top
Generating Code
Pattern logic generation
From the search, scan, database, or system trackign results select the pattern(s) you wish to generate the logic for and click Generate Model Logic.

An example of model logic generation (pseudo code) for a single pattern is shown below

The logic generated may be saved by clicking on File and then Save.
In the case of delay patterns, all bars in the code are shifted according to the delay value. Therefore, the delay is already accounted for when a signal is generated for the appropriate entry point (open or close).
Top
EasyLanguage code generation
EasyLanguage code generation
From the search, scan, database, or system trackign results select the pattern(s) you wish to generate the logic for and click Generate EasyLanguage Code.

Select the code version (TS2000i or TS) and click OK. An example of Easylanguage TS code generation for a single pattern is shown below

The code generated may be saved by clicking on File and then Save.
You may copy and paste the code into Tradestation. You may have to remove some blank or other characters causing errors when verifying the signal.
In the case of delay patterns, all bars in the code are shifted according to the delay value. Therefore, the delay is already accounted for when a signal is generated for the appropriate entry point (open or close).
Note: the input variable values are initially set to zero in the generated code and they must be specified in Tradestation.
Raw code is generated automatically and saved in a text file. Each line of the file contains the following:
Pattern Code;File;Type;TradeOn,Target;Stop;C
where File is the filename, Type is LONG OR SHORT, TradeOn is Open or Close, Target is the profit target, stop is the stop-loss and C is % or pts. Pattern Code is the formula code used by the native language of the various supported platforms.
The raw code generation applies only to the Search and Database results. Two files with identical content are saved automatically in sub-directory Results:
(1) A file called GeneratedCode.txt which is overwritten every time new code is generated.
(2) A file with the name: RawCode_mm_dd_yyyy_hh_mm.txt
This file is overwritten only if new code generation takes place during the same minute mm that the file was initially generated.
The text files containing raw code can be deleted using a new tool added to File Maintenance under Results and called "Code .TXT FILES".
FAQ: What values should be used for the input variables in the generated Easylanguage code?
In the generated Easylanguage code, the input variables are set equal to 0 and must be set to the correct value manually by the user.
(1) In the case of percent ( "%" ) targets and stops:
You need to set the proper values of the following input variables according to the values used in the T/S file shown in the generated code header:
input: ptarget(0), stopl(0);
For example, if the target is 3% and the stop 2% then:
input: ptarget(3), stopl(2);
The correct values are always shown in the headers of the generated code for each pattern. For example:
LONG , % , TARGET : 8 , STOP : 6 , ENTRY PRICE : CLOSE , DELAY : 0
In this particular header, the target is 8% and the stop is 6% and the line should change to:
input: ptarget(8), stopl(6);
(2) In the case of point ( "pts" ) targets and stops:
You need to set the proper values of all input variables according to the values used in the T/S file shown in the generated code header and the appropriate price scale of the instrument traded: If the target is 75 pips and the stop is 50 pips then:
input: targetpoints(0.0075), stoppoints(0.0050), multiplier(10000);
The correct values are always shown in the headers of the generated code for each pattern. For example:
LONG , pts , TARGET : 0.01 , STOP : 0.01 , ENTRY PRICE : OPEN , DELAY : 0
In this particular header, the target is 0.01 and the stop is 0.01:
input: targetpoints(0.01), stoppoints(0.01), multiplier(10000);
In the above example the multiplier value was set to 10000 to reflect that the values are related to eurusd forex trading where the price scale is often equal to 10000. In general, the multiplier is related to the price scale. For example, for equities the price scale is 100, for bond futures 32 and for eurusd forex 10000 in most cases. Please consult your Easylanguage manual to find out how the variables should be adjusted in the case of point targets and stops.
Top
Metastock code generation
Metastock code generation
From the search, scan, database, or system trackign results select the pattern(s) you wish to generate the logic for and click Generate Metastock Code.

An example of Metastock code generation for three patterns is shown below

The code generated may be saved by clicking on File and then Save.
You may copy and paste the code into Metastock. You may have to remove some blanks or other characters for proper operation.
For patterns with delay: For Trade on Open use a Delay value equal to 1 in the Metastock tester options. For Trade on Close use a Delay value of 0.
Raw code is generated automatically and saved in a text file. Each line of the file contains the following:
Pattern Code;File;Type;TradeOn,Target;Stop;C
where File is the filename, Type is LONG OR SHORT, TradeOn is Open or Close, Target is the profit target, stop is the stop-loss and C is % or pts. Pattern Code is the formula code used by the native language of the various supported platforms.
The raw code generation applies only to the Search and Database results. Two files with identical content are saved automatically in sub-directory Results:
(1) A file called GeneratedCode.txt which is overwritten every time new code is generated.
(2) A file with the name: RawCode_mm_dd_yyyy_hh_mm.txt
This file is overwritten only if new code generation takes place during the same minute mm that the file was initially generated.
The text files containing raw code can be deleted using a new tool added to File Maintenance under Results and called "Code .TXT FILES".
The following are the recommended step for using the PAL generated code in Metastock:
1. Copy and paste the generated formula code (just the formula part) in a new System Tester strategy (Go Tools and then System Tester and click New) 2. If this is a long pattern click the Enter Long tab and paste the formula there. If this is a short pattern click the Enter Short tab and paste the formula there. Do not enter anything in the Close Long or Close Short tabs. 3. Click Stops and input you profit target and Max Loss (stop-loss) values. Mark the appropriate Positions box and the box Exit at Stop Price. Also mark the appropriate box indicating whether this is a percent or point stop. Do not forget to keep all other stop tabs (breakeven inactivity, Trailing) unmarked. 4. Click OK and then OK again and then click Options on the main System Tester screen while your strategy is highlighted. Select the Entry Price (open or close). The exit price can be set to High. The delay is 1 in the case of no delay signals. 5. All the necessary values one must input in the strategy Stops and System Tester Option tabs are listed above the formula code generated by PAL, such as the profit target and stop-loss values, value of the delay, entry price, etc.
Top
Wealth-Lab 4 code generation
Wealth-Lab 4 code generation
From the search, scan, database, or system trackign results select the pattern(s) you wish to generate the logic for and click Wealth-Lab Code.

An example of Wealth-Lab code generation for a single pattern is shown below

The code generated may be saved by clicking on File and then Save.
You may copy and paste the code into Wealth-Lab. You may have to remove some blank or other characters causing errors.
In the case of delay patterns, all bars in the code are shifted according to the delay value. Therefore, the delay is already accounted for when a signal is generated for the appropriate entry point (open or close).
Raw code is generated automatically and saved in a text file. Each line of the file contains the following:
Pattern Code;File;Type;TradeOn,Target;Stop;C
where File is the filename, Type is LONG OR SHORT, TradeOn is Open or Close, Target is the profit target, stop is the stop-loss and C is % or pts. Pattern Code is the formula code used by the native language of the various supported platforms.
The raw code generation applies only to the Search and Database results. Two files with identical content are saved automatically in sub-directory Results:
(1) A file called GeneratedCode.txt which is overwritten every time new code is generated.
(2) A file with the name: RawCode_mm_dd_yyyy_hh_mm.txt
This file is overwritten only if new code generation takes place during the same minute mm that the file was initially generated.
The text files containing raw code can be deleted using a new tool added to File Maintenance under Results and called "Code .TXT FILES".
Top
TeleChart code generation
TeleChart code generation
From the search, scan, database, or system trackign results select the pattern(s) you wish to generate the logic for and click TeleChart Code.

An example of TeleChart code generation for a single pattern is shown below

The code generated may be saved by clicking on File and then Save.
You may copy and paste the code into a PCF in Telechart. You may have to remove some blank or other characters causing errors when TeleChart verifies the PCF.
In the case of delay patterns, all bars in the code are shifted according to the delay value. Therefore, the delay is already accounted for. When a TeleChart scan using a PCF with a delay pattern indicates a TRUE value then a signal is generated for the next open or close.
Raw code is generated automatically and saved in a text file. Each line of the file contains the following:
Pattern Code;File;Type;TradeOn,Target;Stop;C
where File is the filename, Type is LONG OR SHORT, TradeOn is Open or Close, Target is the profit target, stop is the stop-loss and C is % or pts. Pattern Code is the formula code used by the native language of the various supported platforms.
The raw code generation applies only to the Search and Database results. Two files with identical content are saved automatically in sub-directory Results:
(1) A file called GeneratedCode.txt which is overwritten every time new code is generated.
(2) A file with the name: RawCode_mm_dd_yyyy_hh_mm.txt
This file is overwritten only if new code generation takes place during the same minute mm that the file was initially generated.
The text files containing raw code can be deleted using a new tool added to File Maintenance under Results and called "Code .TXT FILES".
Top
NinjaTrader code generation
NinjaTrader code generation
From the search, scan, database, or system trackign results select the pattern(s) you wish to generate the logic for and click NinjaTrader Code.

An example of condition code generation for a single pattern is shown below

The code generated may be saved by clicking on File and then Save.
The condition code can be used with the proper entry and exit statements in NinjaTrader programming language.
In the case of delay patterns, all bars in the code are shifted according to the delay value. Therefore, the delay is already accounted for.
Raw code is generated automatically and saved in a text file. Each line of the file contains the following:
Pattern Code;File;Type;TradeOn,Target;Stop;C
where File is the filename, Type is LONG OR SHORT, TradeOn is Open or Close, Target is the profit target, stop is the stop-loss and C is % or pts. Pattern Code is the formula code used by the native language of the various supported platforms.
The raw code generation applies only to the Search and Database results. Two files with identical content are saved automatically in sub-directory Results:
(1) A file called GeneratedCode.txt which is overwritten every time new code is generated.
(2) A file with the name: RawCode_mm_dd_yyyy_hh_mm.txt
This file is overwritten only if new code generation takes place during the same minute mm that the file was initially generated.
The text files containing raw code can be deleted using a new tool added to File Maintenance under Results and called "Code .TXT FILES".
Top
MetaTrader code generation
MetaTrader code generation
From the search, scan, database, or system trackign results select the pattern(s) you wish to generate the logic for and click MetaTrader Code.

An example of condition code generation for a single pattern is shown below

The code generated may be saved by clicking on File and then Save.
The condition code can be used with the proper entry and exit statements in MetaTrader programming language.
In the case of delay patterns, all bars in the code are shifted according to the delay value. Therefore, the delay is already accounted for.
Raw code is generated automatically and saved in a text file. Each line of the file contains the following:
Pattern Code;File;Type;TradeOn,Target;Stop;C
where File is the filename, Type is LONG OR SHORT, TradeOn is Open or Close, Target is the profit target, stop is the stop-loss and C is % or pts. Pattern Code is the formula code used by the native language of the various supported platforms.
The raw code generation applies only to the Search and Database results. Two files with identical content are saved automatically in sub-directory Results:
(1) A file called GeneratedCode.txt which is overwritten every time new code is generated.
(2) A file with the name: RawCode_mm_dd_yyyy_hh_mm.txt
This file is overwritten only if new code generation takes place during the same minute mm that the file was initially generated.
The text files containing raw code can be deleted using a new tool added to File Maintenance under Results and called "Code .TXT FILES".
Top
Amibroker code generation
Amibroker code generation
From the search, scan, database, or system trackign results select the pattern(s) you wish to generate the logic for and click Amibroker Code.

An example of condition code generation for a single pattern is shown below

The code generated may be saved by clicking on File and then Save.
The condition code can be used with the proper entry and exit statements in Amibroker programming language.
In the case of delay patterns, all bars in the code are shifted according to the delay value. Therefore, the delay is already accounted for.
Raw code is generated automatically and saved in a text file. Each line of the file contains the following:
Pattern Code;File;Type;TradeOn,Target;Stop;C
where File is the filename, Type is LONG OR SHORT, TradeOn is Open or Close, Target is the profit target, stop is the stop-loss and C is % or pts. Pattern Code is the formula code used by the native language of the various supported platforms.
The raw code generation applies only to the Search and Database results. Two files with identical content are saved automatically in sub-directory Results:
(1) A file called GeneratedCode.txt which is overwritten every time new code is generated.
(2) A file with the name: RawCode_mm_dd_yyyy_hh_mm.txt
This file is overwritten only if new code generation takes place during the same minute mm that the file was initially generated.
The text files containing raw code can be deleted using a new tool added to File Maintenance under Results and called "Code .TXT FILES".
Top
Adding trading systems to System Tracking
Adding trading systems to System Tracking
From search, scan, or database results select the pattern(s) you wish to include in a trading system and then click System Tracking:

Click Yes to confirm or No to abort. If you click Yes you must specify the name of the new trading system and the directory where the data file is found, in the case you would like to define a different directory than the one specified in the results. If you specify a different directory, the file name must be the same as the one shown in the results.

The new system appears in the System Tracking list of systems:

You may group the patterns in the results in any way you choose and then add a system to System Tracking. In the following example, results for QQQQ are used to create two trading systems, one with long patterns only and another with short patterns only Each system must be assigned a different name.
Example 1. Defining a trading system by including only long patterns from the following results

Select all long patterns only:

Click on System Tracking to add the system. You will need to confirm the addition and then specify a name for the system and a location for the data.



Click Exit to close the system tracking window and then repeat the same procedure for adding a new trading system with short patterns only.
Deleting systems and changing data location
You may delete a system by selecting it from the system tracking list and then pressing the Del (Delete) key on the keyboard. The directory of the data file(s) for a specific system can be changed by selecting it first and then pressing the Ins (Insert) key on the keyboard.
Top
System Tracking reports
System Tracking reports
In order to get a report of new signals generated by the trading systems added to System Tracking, you must first update all data files used by those systems in the Data Locations shown in the System Tracking list as of the last trading day's close. Then, from the main program menu click System Tracking

Click Run to generate a report of new trading signals. Below is an example of a typical System Tracking report

SIGNAL can be THIS CLOSE, NEXT OPEN or NEXT CLOSE
THIS CLOSE applies to trading signals generated already as of the close of the last trading day. The problem with this type of signals is that by the time you get the system tracking report it is too late to place the trade. Therefore, one must track the signals listed as NEXT CLOSE and determine any trades needed to be placed on the next bar close, according to the conditions listed under the CONDITIONS column. This type of signal are generated when the Close is specified as the trade entry point on a search workspace.
NEXT OPEN applies to patterns that have confirmed the completion of their formation as of the close of the last trading day and generate a new position at the open of the next trading day. If the signal is due to a pattern with a delay, the pattern plus delay has already formed and any new positions must be placed at the open of next day. The delay value will be shown in the CONDITION column.
NEXT CLOSE refers to patterns that are candidates for generating a position at the next close depending on that day's range or a delay pattern already formed and Delay - 1 bars have elapsed. The conditions that must be met in order to generate a signal are listed under CONDITIONS. If the signal is due to a pattern having a trade input delay, the delay value will be shown in the CONDITION column.
POSITION can be either LONG or SHORT depending on the pattern type.
SYMBOL indicates the data file name.
SYSTEM lists the trading system name incorporating the pattern.
SAVED indicates the date the model was saved in system tracking
TARGET is the profit target
STOP is the stop-loss
LAST DATE is the last trading day in the data file used by the system tracking
CONDITION is active in the case there are candidate patterns for generating a trading signal at the close of the next trading day. The conditions needed to be satisfied are listed
INDEX denotes the general group the patterns belongs to (1 to 100). This number is used by the program for pattern classification purposes.
Index Date is the date of the most recent occurrence of a pattern in the data file and it is used for classification purposes
The system tracking report can be saved by clicking Save. To print a report select print.
Top
Viewing Trading Systems
Viewing Trading Systems
To view the patterns in a trading system in System Tracking, click System Tracking from the main program menu.

Select a trading system (highlight it). In this case the first system QQQQ is highlighted:

Click View to get the list of the price patterns that comprise the system:

File Name is the data file used in the search or scan
Index denotes the general group the patterns belongs to (1 to 100). This number is used by the program for pattern classification purposes.
Index Date is the date of the most recent occurrence of a pattern in the data file for Pattern Search results. In the case of Pattern Scan results, it is always the last date in the data file.
Trade on is either Open or Close and refers to the trade entry point. In the case that the Delay option was activated, these fields will show as Open(n) or Close(n) (ex. Open2, Close1). The value for (n) is the best delay for the specific price pattern and it is determined based on the best historical profitability.
PS is the percent profitability (success rate of patterns for long positions. In this case PS = 100 - PL
PS is the percent profitability of patterns for short positions. In this case PL = 100 - PS
CL is the number of maximum consecutive losers of the pattern.
Type is either Long or Short. Patterns with a Long type are used for taking long positions and Short types for taking short positions. PL is the profitability of long patterns and PS the profitability of short patterns.
Target shows the profit target value used in the search or scan
Stop shows the stop-loss value used in the search or scan
C indicates the type OF exit applied, % stands for percentages, inc for points and NC for next close exit (scan results only). In case NC is indicated as the exit, any Target and Stop values specified in the T/S file are not used.
Last Date is the most recent date (last) in the data file
You can chose any of the following options::

Generate Metastock Code generates Metastock code for the patterns selected.
Generate EasyLanguage Code generates EasyLanguage code for the patterns selected
Generate Model Logic generates the model logic for the patterns selected
Generate Wealth-Lab Code generates WealthScript for the patterns selected
Generate TeleChart Code generates PCF compatible code for the patterns selected
Generate NinjaTrader Code generates condition code for NinjaTrader
Generate MetaTrader Code generates condition code for MetaTrader
Generate Amibroker Code generates condition code in Amibroker AFL
Show Open Positions generates a list of open position (if present) for the selected trading system
Back-testing patterns in System Tracking
To back-test the patterns of a system saved in System Tracking, select the system first and then click View. Then, highlight a pattern to back-test and right click on mouse or hit the F3 key. You must specify the directory where the data file for the specific pattern can be found by the program.
Top
Generating Trading System Open Positions
Generating Trading System Open Positions
To get a list of open positions for a particular trading system that is listed in System Tracking, highlight it first and then click View. In this examples, the system SPY is highlighted:


The list of open positions (if present) can be obtained by clicking Show Open Positions:

Select the directory with the update data file(s) is different from default and click OK:

The report lists each pattern with an open position, the position entry and last date, and whether the position in an open loss or gain. Additional details about each pattern with open position are displayed.
Entry date is the date the position was opened. Last date is the last date in the data file used. The closing price of the last date is used to determine Profit/Loss.
The open position report can be saved as a .txt file for further processing. The file is saved in directory ..\PriceActionLab\Results under the name Openpositions+(Trading System Name) + (date).txt. (If you cannot find the file after you saved it, use the windows Search option).
Notes:
1) This function should be used only after all data files are properly updated in the directories specified in System Tracking
2) The function can be used with trading systems that include multiple data files and risk/reward parameters
3) Only one trading system at a time can be checked for open positions
4) This function is more suitable for use with daily data
Hint:
Show Open Positions can be used as part of a strategy based on coincident pattern formations with the objective of increasing the probability of success of a given position.
Warning:
If a trading system includes multiple data files, all must be located in the same directory, which is specified as soon as Show Open Position is clicked.
Top
Daily Data Conversion
Daily Data Conversion
Form the main program menu click Tools and then Data File Conversion

Select the Source file to convert and specify its format in the Source File Settings. It is recommended to use a text editor in order to determine the format of the file before attempting to make the conversion. Select the Metastock compatible option if the source file was created by Metastock.

To convert to PAL compatible format mark the PAL Compatible option in the Target File Settings. Click Convert, select the file extension desired (.asc or .txt), the directory to store the new file and the new file name. Click Save to complete the conversion.

The following ASCII formats can be converted to a format compatible with PAL or to other formats:
Metastock ASCII files (These files include a header line)
Date format: YYMMDD with the OPEN, HIGH, LOW AND CLOSE fields all space or comma delimited, no header line
Date format: MM/DD/YYYY with the OPEN, HIGH, LOW AND CLOSE field all space or comma delimited, no header line
Note 1: When generating Metastock daily ASCII the data header must have the following form:
<TICKER>,<PER>,<DTYYYYMMDD>,<OPEN>,<HIGH>,<LOW>,<CLOSE>
Use the Destination options of the Metastock Downloader and select all output fields except Time, Volume and Open Interest
Note 2: When converting Metastock ASCII files to PAL compatible format the header will be removed from the target file.
Warning! When converting Metastock daly data to Metastock ASCII text, uncheck the TIME field from the convert options. If you leave the TIME field, the Open field of the file converted to ASCII text will have zero values for the Open price throughout the data file.
Instructions for converting Metastock daily data:
Step 1: Converting Metastock format to ASCII text using the downloader
- From the Metastock downloader select Tools and then Convert. Set the source file to Metastock format and the target to ASCII text. Select the folder to save the converted file and specify the file name.
- Click Options and in the Destination part of the Conversion Options of the Downloader mark the Replace existing file and Create new files boxes. Then, for the fields to output mark all EXCEPT Time, Volume and Open Interest. When done, click Apply and then OK. Then click OK again to have the file converted.
Step 2: Converting Metastock ASCII text format to PAL format using the Tools utility.
- From the main program menu select Tools and then Data file Conversion.
- Select the source file that was converted by the downloader from the directory it was saved and make sure the Metastock compatible option is marked in the file settings.
- In the target file settings leave marked default PAL Compatible format and click Convert. Select a new directory to save the file in PAL format (or the same directory with a different file name) and click Save to complete the conversion.
Top
Metastock Multiple Conversions
Metastock Multiple Conversions
You may use Metastock ASCII Conversion from the Tools menu to convert several daily data files in Metastock ASCII text format to PAL format. This is especially useful when using the pattern scan feature of the program and daily data updates are in Metastock format.
Before using this conversion utility, the Metastock downloader must be used to create the ASCII text files and save them, each with a different name. When using the Metastock downloader you have the option to convert several files at once by specifying *.txt as the target file. (Please refer to the Metastock downloader manual).
Important: When converting Metastock format to Metastock ASCII text using the downloader, click on Convert and then click Destination options to select the appropriate fields to output. DESELECT the TIME, VOLUME and OPEN INTEREST fields and then click Apply.
From the main menu click tools and then Multiple File Conversion

Select the directory where you have saved the Metastock converted files to ascii text (in the example "tempw"):

Select the files to convert (or mark the Select All check box). Specify the target directory to save the converted files to. A confirmation message indicating completion of the conversion will appear.
Top
Intraday Data Conversion
Intraday Data File Conversions
Intraday data is used in Price Action Lab exactly as daily data. The program does not consider time in its algorithm and this speeds the execution time significantly. In order to use intraday data an ASCII text file must be created, in which the time field is omitted and the date field is replaced by and increasing 8-digit integer: Example:
10000001 1492.25 1493.50 1486.75 1489.25 10000002 1489.00 1489.25 1482.50 1485.50 10000003 1485.75 1488.00 1484.00 1484.75
You can use the Intraday File Creation tool from the Main menu of the program to convert several popular intraday data formats to an intraday file for use with PAL. Please note: Using Price Action Lab with tick data is not recommended since the Open, High, Low and Close have the same value.
Form the main program menu click Tools and then Intraday File Creation

Select the Source file to convert and specify its format from the Source File Settings. It is recommended to use a text editor in order to determine the exact format of the file before attempting to make the conversion. Select the Metastock compatible option if the source file was created by Metastock.

Click Convert, select the file extension desired (.asc or .txt), the directory to store the new file and the new file name. Click Save to complete the conversion.

The following intraday ASCII formats can be converted to a format compatible with PAL using the Intraday File Creation tool:
1. Metastock ASCII files. (These files include a header line)
2. Date format: YYMMDD with the TIME, OPEN, HIGH, LOW AND CLOSE fields all space or comma delimited, no header line
3. Date format: MM/DD/YYYY with the TIME, OPEN, HIGH, LOW AND CLOSE field all space or comma delimited, no header line
Note 1: When generating Metastock intraday ASCII, the data header must have the following form:
<TICKER>,<PER>,<DTYYYYMMDD>,<TIME>,<OPEN>,<HIGH>,<LOW>,<CLOSE>
Use the Destination options of the Metastock Downloader and select all output fields except Volume and Open Interest
Note 2: When converting Metastock ASCII files to PAL compatible format tthe header is not present any longer in the target file.
Instructions for converting Metastock intraday data to PAL format:
Step 1: Converting Metastock format to ASCII text using the downloader
- From the Metastock downloader select Tools and then Convert. Set the source file to Metastock format and the target to ASCII text. Select the folder to save the converted file and specify the file name.
- Click Options and in the Destination part of the Conversion Options of the Downloader mark the Replace existing file and Create new files boxes. Then, for the fields to output mark all EXCEPT Volume and Open Interest. When done, click Apply and then OK. Then click OK again to have the file converted.
Step 2:: Converting Metastock ASCII text format to PAL format using the Tools utility.
- From the main menu select Tools and then Intraday File Creation.
- Select the source file that was converted by the downloader from the directory it was saved and make sure the Metastock compatible option is marked in the file settings.
- In the target file settings leave checked the default PAL compatible format and click Convert. Select a new directory to save the file in PAL format (or the same directory with a different file name) and click Save to complete the conversion.
Top
File Maintenance
File Maintenance
From the main program menu click Tools and then File Maintenance.

You can use the File Maintenance tool for housekeeping purposes. Clicking the appropriate button provides a list of corresponding files. You can delete files by marking the box next to them or you can delete all files by marking Select All.
If you have saved workspaces, results, T/S or data files in directories of your choice, click the appropriate button on the left to activate the file extension and then search for the directory where the files are located.
Warning! Deletion of files is permanent and they cannot be recovered. Exercise caution when deleting files, especially with extensions .txt or .asc, as they may be not related to Price Action Lab.
Top
Data File Test
Data File Test
From the main program menu click Tools and then Data File Test:


You can use the Data File Test tool to check for errors in data files such as:
1. Bad format 2. Open and/or Close outside High-Low range 3. High less than Low 4. Zero values 5. Change in Open, High, Low or Close larger than 40% from the previous bar
A list of all files in the default DATA directory is first displayed but you can select any directory you like by doublecking it. You can select the files to test by marking the box next to them or you can have all files tested by marking Select All.
Note: The errors reported on the screen are also saved in a text file called Errors.log which can be found in the default Results directory (normally: c:\Program Files\PriceActionLab\Results)
Top
Profitability Calculator
Profitability Calculator
From the main program menu click Tools and then Profitability Calculator

Input the value for the desired profit factor and the values of the profit target, stop-loss and then click Calculate to see the approximate value of the percent profitability (success rate).

The equation for the percent profitability as a function of the profit factor and ratio of average winning to average losing trade is derive in the book by Michael Harris, Profitability and Systematic Trading as:
P = 100 x PF/(PF + Rwl)
where P stands for the percent profitability (ratio of winning to total trades), PF is the profit factor (equal to sum of winning trades divided by the sum of losing trades) and Rwl the average winning to average losing trade. A modified formula is used in the Profitability Calculator as follows:
Pa = 100 x PF/[PF + (T/S)]
where Pa is the approximate percent profitability, T is the profit target and S the stop-loss. In the case of short-term price patterns, the theoretical and approximate values of the percent profitability are close, provided a sufficient number of trades is generated in the price history considered.
You can access the profitability Calculator while creating a search or scan workspace in order to determine the appropriate value of the minimum profitability. The profit target T and stop-loss S can be specified either as percentages of the entry price or increments added to the entry price (points) and must correspond to the values specified in the T/S file. If the T/S file contains multiple sets of profit target/stop-loss values, then the maximum value for the calculated profitability must be used.
Note: Local Regional Settings are overwritten with English Regional Settings conventions. Use "." for the decimal point.
Warning: T and S must be both specified as percentages or increments (points). Mixed values (one specified as percent and the other as increment) may give misleading figures for the percent profitability.
Top
Number of Shares Calculator
Number of Shares Calculator
From the main program menu click Tools and then Number of Shares Calculator:

The calculator determines the number of shares given the trading capital value, the risk percent per trade, and for stop-loss either in points or as a percentage of the entry price. The calculation requires the approximate entry price in the case of percent stop-loss and to determine the maximum number of shares allowed. Results are rounded to the next integer value.
This is an example of number of shares calculation ffor a 100K account, 2.75% risk per trade and 2 points stop-loss. The entry price is $52.50.

This is an example of number of shares calculation for a 100K account, 2% risk per trade and 4% stop-loss. The entry price is $25.

The equations are derived in the book by Michael Harris, Profitability and Systematic Trading, and are as follows:
For stop-loss in points: N = (R x M)/(100 x SL)
where N is the number of shares, R is the risk percent per trade (fixed), M is the trading capital and SL the stop-loss in points.
For stop-loss percent: N = (R x M)/(SL x P)
where N is the number of shares, R is the risk percent per trade (fixed), M is the capital at risk, SL the stop-loss as a percentage of the entry price and P the approximate entry price.
Allowable shares = M/P
Note: the calculator can be used in the case of contracts (futures or Forex) provided that the stop-loss corresponds to the amount at risk
Top
Searching for Patterns Across Multiple Instruments
Searching for Profitable Patterns Across Multiple Instruments
Starting with version 3.0, PAL allows searching for patterns that are profitable across a number of instruments, also called "common patterns" in the software. This feature provides another method of cross-validation of results that is believed to be very powerful - even more powerful than out_of_sample/forward testing - in the sense that the significance of patterns that are profitable across several instruments is higher because of the fact that they perform well not only with one instrument - something that can be the result of pure selection bias - but with many instruments and as a result any selection bias is reduced as a function of the number of such instruments involved.
PAL makes it extremely easy to discover such patterns. Version 3.0 provides a check box on the search workspace and a field to specify the minimum profit factor that each pattern in the results must have when backtested across different instruments.
How it works:
Checking the option Find Common Patterns Only instructs the program to look for patterns in each instrument on the workspace that are also profitable in all other instruments. When the program finds a pattern in one instrument that satisfies the criteria set on the workspace for that particular case, it also backtests its performance in all other instruments using the parameters of the original instrument (target, stop, etc.). If in all cases the profit factors calculated are greater than the minimum profit factor for common patterns (default is 1.00) then, and only then, the pattern is reported in the results.
Two examples are given below for illustration purposes only.
Example 1: Determine profitable patterns across two currency pairs, EURUSD and GBPUSD with 100 pips profit target and stop-loss. Daily data used.
The search workspace is setup as follows:

The first search run is for regular patterns, not common. The results are shown below. A total of 86 patterns were found.

Next, using the same workspace, we mark the "Find Common Patterns Only" box, as shown below:

The new search found 33 patterns that are common to both currency pairs.

Example 2: Determine profitable patterns across 3 ETFs, DIA, QQQ and SPY. The search workspace setup is shown below:

The regular search (no common patterns) yielded 166 patterns in total.

Next, the "Find Common Patterns Only" option is checked:

The results of the new search for common patterns are shown below. In this case, 78 patterns were found:

Notes:
(1) The chances of finding common patterns decreases with the number of instruments and as the Common Profit Factor value is inreased. (2) When this option is selected, all data files on the workspace must have the same point value in the case point stops are used. For example, when using currency pairs with point stops (pips), often EURUSD and USDJPY have different point values. These must be adjusted in the historical file before the search for common patterns so that a point stop of 0.01 in EURUSD ( 100 pips), for example, also corresponds to the same number of pips in USDJPY.
Top
Creating workspaces for multiple searches
Creating workspaces for multiple searches
The multiple search lines on a Search Workspace can be used to create multiple searches for the same or different data files with different search parameters. Different search lines may be created to reflect any of the following:
1. T/S files with different profit-target and stop-loss objectives 2. Mixture of percentage and incremental profit-targets and stop-losses 3. Different criteria for the minimum profitability, minimum trades and maximum consecutive losers.. 4. Different trade input points (Open or Close) and delay ranges 5. Different data file

Each line is created separately. The minimum profit factor, Search Range, Extended search and Include Patterns with Equal Values options are common to all lines in the workspace.
Tip: A single Search Workspace may be created to contain all markets of interest and associated parameters. The multiple search may be executed regularly, like every six months, to reflect the new data and the results used to update trading systems added to system tracking or the code generated.
Top
Automating the daily scan for patterns
Automating the daily scan for patterns
The multiple scan lines on a Scan Workspace may be used for multiple parameter scans of the data files in the same or different data directories or run multiple scans on a specific file using different parameters. Each line may be created to reflect any of the following:
1. T/S files with different profit-target and stop-loss objectives 2. Percentage or point profit-target and stop-loss using appropriate T/S files. 3. Different criteria for the minimum profitability, minimum trades and maximum consecutive losers 4. Different trade input points (Open, Close or Nexr Close) 5. Different data directory or data file
In the example below, the first line is a scan of all stocks in directory C:with T/S file 5.trs, the second line a scan of just one stock in directory C:, MSFT, with T/S file 7.trs and the third line is a scan of QQQQ for Next Close exit. .

Each line in multiple scans is created separately. The Extended Scan and the Include Patterns with Equal Values options are common to all lines in the workspace.
Tip: A single Scan Workspace may be designed to contain all markets of interest and associated parameters. The multiple scan may be executed daily after updating all historical data files in the directories used by the program and specified on the scan workspace.
Top
Creating trading systems using grouping methods
Creating trading systems using grouping methods
Trading systems developed by grouping price patterns exhibit some very interesting properties. Each individual pattern or a group of patterns can be considered as a trading sub-system. There are many different ways the grouping can take place, depending on any common characteristics of the patterns involved. Different sub-groups can be grouped to form new groups, and so on. The possibilities are endless.
The practical implications from this property of price patterns are many and allow increased flexibility in managing trading risk, amongst other things. For example, one possible grouping may be based on the maximum number of consecutive losers, as follows:
Group 1: Based on maximum consecutive losers
Sub-group 1: Patterns with less than 2 consecutive losers Sub-group 2: Patterns with less than 4 but more than 1 consecutive losers Sub-group 3: Patterns with less than 6 but more than 3 consecutive losers
The above grouping may be called a CL Group (Consecutive Losers Group). Another possible grouping is by profit target and stop-loss magnitude:
Group 2: Based on profit target and stop-loss
Sub-group 1: Patterns with profit target less or equal to 2% Sub-group 2: Patterns with profit target greater than 2% Sub-group 3: Patterns with stop-loss less or equal 4% Sub-group 4: Patterns with stop-loss greater to 4%
The above may be called a Profit and Loss Grouping (PLG).
Groups may not be mutually exclusive, i.e. members of one group can be also members of another.
Grouping and sub-grouping allow increased flexibility in managing trading risk. For a discussion on this subject look at the references provided.
Top
Using multiple trading signals effectively
Using multiple trading signals effectively
Trading systems based on price patterns generate trading signals in numbers proportional to the number of patterns involved. The more patterns present in the model, the more trading signals are generated. One may define three different types of trading signals:
1. Signals indicating a position in the opposite direction of an already open position. 2. Signals indicating a position in the same direction of an already open position. 3. Signals that occur at exactly the same time all indicating a position in the same direction.
Type 1 above can be handled by closing the open position. A riskier approach is to reverse position, by closing the open position and initiating a new one in the opposite direction.
Types 2 and 3 give rise to some very interesting properties of pattern based trading systems and provide flexibility in managing the size of a position and its risk.
Successive are called patterns with open positions that do not overlap. A new trading signal comes after the position of the previous signal is closed by either hitting a profit target or a stop-loss.
Coincident are called patterns with overlapping open positions. A new trading signal indicates a position in the same direction of an already open position.
Clustered are called patterns generating trading signals simultaneously, all in the same direction. Each trading signal in the cluster may have a different profit target and stops-loss.
There are several ways one can deal with the different types of patterns and take advantage of multiple trading signals:
A. Ignore coincident signals. This is the simplest way of using trading systems based on price patterns. Whenever a signal is generated in the same direction with an already open position, that signal is just neglected.
B. Use coincident signals to increase position size.
C. Use coincident signals to move the stops-loss/profit-targets. This is a useful application of coincident signals. When a coincident signal arrives, it may be used to move a stop-loss to a new level, in accordance with the new signal entry price. The same applies to the profit target.
D. Use of clustered signals for confirmation. When clusters of trading signals are generated, they can be interpreted as either a confirmation of an existing position or as a new position with increased probability of success.
For a discussion on the subject of multiple trading signals look at the references provided.
Top
Using Delay Patterns
Using Delay Patterns
Delay patterns are useful in short-term trading because they can act as a filter of price corrections. The program determines the best value of the delay for the patterns it discovers based on the range of values specified by the user. With the delay option activated, it is often the case that more patterns that satisfy the performance criteria set in the search workspace can be found. If a delay is not used, some patterns may suffer an immediate correction after forming and generate more losers than winners due to profit taking. The delay often acts as a filter to corrections, allowing prices to recover before a position is established and resulting in a higher profitability for a trading system.
When specifying a delay in a search workspace, the results include patterns with and without delay. The following are recommended:
A. Using a delay in the range of 1 - 5 B. Creating separate models for patterns with and without delay and adding those to system tracking
A. Using a delay slows down the search algorithm because it must determine the historical performance of each candidate pattern formation for each of the values in the range specified for the delay. Although the allowable range for the delay values is 1 through 25, using the default values is recommended ( 1- 5 ).
B. Clicking the Trade On column label in search results workspace allows sorting patterns according to delay values. Different trading systems may be added to system tracking by selecting patterns with and without delay, or according to delay values. In the following example for QQQQ, only patterns with delay values 2 and 3 are selected to add to system tracking:

More information about delay patterns can be found in the introduction of this manual.
Top
Disclaimer
Disclaimer
PLEASE READ CAREFULLY THE FOLLOWING DISCLAIMER
The trading systems or patterns developed using the Price Action Lab (PAL) software do not and cannot guarantee that you will make profits, or minimize losses of new or existing market positions. Any trading systems developed or included in the software are intended merely as examples and none is recommended. Note that results based upon hypothetical or historically-tested trading systems do not necessarily compare to results of actual trading. No hypothetical or historical trading record can completely account for all risk factors present in actual trading. There is no guarantee that any hypothetical or simulated trading results will produce comparable actual trading results. On the contrary, there are many known and unknown factors which may contribute to wide deviations between hypothetical and actual trading results, such as market liquidity and human emotions. Trading involves substantial risks, including possible loss of principal and other losses. The PAL software is designed to provide a training tool for trading system development. It is licensed to you with the understanding that its author is not engaged in rendering any investment or other professional advice. If investment or other professional advice is required, a licensed professional should be consulted. Nobody, whether employee, agent or representative of the author is authorized to provide any such advice, and any such advice, if given, is in violation of the author policy.
U.S. Government Required Disclaimer - Commodity Futures, Trading Commission Futures, Derivatives and Options trading has large potential rewards, but also large potential risk. You must be aware of the risks and be willing to accept them in order to invest in the futures and options markets. Don't trade with money you can't afford to lose. This is neither a solicitation nor an offer to Buy/Sell futures or options. The past performance of any trading system or methodology is not necessarily indicative of future results.
CFTC RULE 4.41 - HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.
Use of Price Action Lab is the sole responsibility of the buyer. Past results are not necessarily indicative of future results and, therefore, it should not be assumed that use of the software will result in trading profits. The program author makes no claim that use of its software can result in trading profits and he or any directors, employees or assigns cannot be held responsible for any trading losses occurred as a result of the use, or inability to use, the software sold. Any type of trading activity, such as futures, options, currency or stock trading, involves substantial financial risks. Short-term and day trading are only suitable to those having a full understanding of the risks involved and can afford to lose.
Top
References
References
For further reading you may consider the following books:

Profitability and Systematic Trading: A Quantitative Approach to Profitability, Risk, and Money Management , by Michael Harris, Wiley, 2008, Hardcover, 224 pages. A must read!

Stock Trading Techniques Based on Price Patterns, by Michael Harris, Traders Press Inc., 2001. The material in this book concentrates on stock trading and features an in-depth discussion of the methods and techniques used to develop software similar to PAL.
Top
Contact information
Contact information
Web site: http://www.priceactionlab.com
Top
Copyright notices
Copyright notices
© Copyright 2010 - 2011 Harrison Investments, Inc.
Parts of this help file were developed with Shalom Help Maker
Get tour free copy here www.danish-shareware.dk/soft/shelpm/
The Software and its documentation contains registered and unregistered trademarks of Harrison Investments, Inc. and trade names of other companies. In certain cases, registrations therefor are pending.
MetaStock® is a registered trademark and a product of Equis International, A Reuters Company
EasyLanguage® and Tradestation are registered trademark of TradeStation Technologies, Inc.
Wealth-Lab and WealthScript are trademarks of WL Systems, Inc.
TeleChart is a trademark of Worden Brothers, Inc.
NinjaTrader is a trademark of NinjaTrader, LLC.
MetaTrader is a trademark of Metaquotes Software Corp.
Amibroker is a trademark of Amibroker.com
Warning: This computer program is protected by copyright law and International treaties. Unauthorized reproduction or distribution of this program, or any portion of it, is strictly prohibited and may result in severe civil and criminal penalties.
Top
|