Scrigroup - Documente si articole

     

HomeDocumenteUploadResurseAlte limbi doc
BulgaraCeha slovacaCroataEnglezaEstonaFinlandezaFranceza
GermanaItalianaLetonaLituanianaMaghiaraOlandezaPoloneza
SarbaSlovenaSpaniolaSuedezaTurcaUcraineana

AdministrationAnimalsArtBiologyBooksBotanicsBusinessCars
ChemistryComputersComunicationsConstructionEcologyEconomyEducationElectronics
EngineeringEntertainmentFinancialFishingGamesGeographyGrammarHealth
HistoryHuman-resourcesLegislationLiteratureManagementsManualsMarketingMathematic
MedicinesMovieMusicNutritionPersonalitiesPhysicPoliticalPsychology
RecipesSociologySoftwareSportsTechnicalTourismVarious

Visual Pattern Designer Professional Getting Started Manual

manuals



+ Font mai mare | - Font mai mic





Visual Pattern Designer

Professional

Getting Started Manual

For use with Omega Research TradeStation or SuperCharts

Off-Line or Real-Time Software.

Visual Pattern Designer Professional

Getting Started Manual

Table of Contents

Disclaimer and Limited Warranty

Software License Agreement

3

Return Policy

Table of Contents

5

Chapter 1 Getting Started

Chapter 2 Installation

Chapter 3 Creating the Example Pages

Chapter 4 Applications

Appendix : Example indicators and system

Chapter 1 Getting Started

Welcome to the Visual Pattern Designer Professional (VPDP). This Getting Started Manual was created in order to give you a step-by-step help to get you up and running with the basic features of this product in the shortest time.

I know that you are anxious to get started to see visual pattern designer professional results, but creating the example pages that are detailed in this Manual will be well worth your time. These procedures contains valuable application methods that answer most of the 'how do I do it' questions.

Remember that trading is a zero-sum game, so you need a positive expected return strategy in order to beat your opponent. This product is intended to be a tool kit to assist you in applying visual pattern recognition to prices and indicators using the many combinations of data streams from Omega Research Charting pages. To obtain in-depth knowledge on the theory and application of price and indicator patterns to markets, I recommend reading any of the many excellent publications available in order to select strategies that fit your trading style and market preference.

For a catalog of the many books describing the patterns that appear in financial markets contact:

Traders Press, Inc., P.O. Box 6206, Greenville, SC 29606. Phone (800) 927-8222

The Traders' Library, P.O. Box 2466, Ellicott City, MD 21041 Phone (800) 227-2855

Customer support for receiving quotes, saving quotes, and data management are the responsibilities of your charting software vendor and your data service vendor.

TradeStation Charting support: (305) 270-9336

DBC Signal data feed support: (800) 762-7538

BMI data feed support:  (800) 255-7374

ComStock data feed support: (800) 431-5019

MicroSoft Product Information (800) 426-9400

MicroSoft FastTips support: (800) 426-9400

If you are having problems getting the software installed or are having problems creating the example pages, you can telephone us for support at (313) 995-1191. This Digital Enterprises product is intended to be a tool kit to assist you in applying pattern recognition in any market. As a part of this product, we do not include any trading advice or any custom trading system development. Specific application development, proprietary system development, or general software development services are available from Digital Enterprises on a contract fee basis. If your business is interested in these consulting services then please call us to schedule an appointment.

Chapter 2 Software Installation

The installation process assumes that Microsoft Windows and Omega Research Charting programs are already installed and running on your computer. The installation process also assumes that you are familiar with the running these programs. If you need help using Microsoft Windows , click your mouse on the Help menu item in the Program Manager window or refer to the Microsoft Windows Users Guide in the chapter Application Basics. If you need help with the Omega Research Charting or Editing programs, refer to the Omega Research User's Manual for TradeStation or SuperCharts .

A brief overview of the installation process is:

i.  View the README.TXT file to see if there are any last minute changes.

ii.  Close any Omega Research program that is running.

iii.  Run the 'Setup' program on the setup disk.

iv.  Use the Omega Research Editor to transfer in example indicators.

v.  Create Omega Research Charting pages and apply the indicators.

Install the Visual Pattern Designer Professional program.

I. Please use a text editor or the Windows notepad editor (NOTEPAD.EXE) to view the README.TXT file on the supplied software disk to review any last minute documentation changes

II. Close any running Omega Research program by using the Exit command from the program menu or the Close command for the Control menu. We need to do this since we cannot overwrite any TradeStation DLL that may already be in use.

III.  Run the SETUP program located on the Visual Pattern Designer Professional floppy disk to create a directory on your hard disk drive, create a program manager group and copy necessary files to your hard drive:

A. Insert the Visual Pattern Designer Professional disk in your floppy drive, for example : A:

B.  From the Windows Program Manager main menu select File, Run..

C.  From the Run dialog box click Browse. Select the setup.exe file from the Visual Pattern Designer Professional setup disk. Click OK

D.  From the Run dialog box Click OK

E.  The Visual Pattern Designer Professional setup dialog box recommends the following default directory C:VPD where the necessary program files will be copied to your hard drive. The Visual Pattern Designer Professional program should be installed on the same disk drive where your Omega Research charting program is located. Click OK.

IV. Installation of Visual Pattern Designer Professional example Indicators.

A.  From the Omega TradeStation Program Manager Group, point with the mouse to the Omega TradeStation Editor icon and double click the left mouse button to run the Omega TradeStation Editor. (SuperCharts users will use the Editor, Transfer commands from the SuperCharts main menu.)

B.  Select Utilities, Transfer from the TradeStation Editor main menu bar.

C.  A Transfer dialog box appears. Use the mouse or the Tab key to enter the appropriate directory information for your computer system. For example:

From C:VPD or the disk drive where the Visual Pattern Designer Professional computer disk is located on your computer. Later, if you want to restore the indicators to their default values that are used in this Getting Started Manual, then you can transfer direct from A: or your floppy disk drive.

The indicators will be transferred to the hard disk drive for the Omega Research Charting program on your computer. The default directory paths for indicators are listed here.

a. To: C:TS for TradeStation Version 3.01

b. To: C:OMEGATS for TradeStation Version 3.5

c. To: C:OMEGASC for SuperCharts Version 2.1

d. To: C:SC for earlier versions of SuperCharts

e.  If your Omega Research charting program is installed in another directory, then enter that path name.

After you have entered the directory information for your computer system, click the OK button to continue.

A Transfer dialog box appears. Select Transfer All and click the OK button to continue. A Transfer dialog box indicates the percentage of the transfer completed for User Function, Studies, and Systems.

a.  If you get an error message indicating that there is not sufficient room for all of the indicators, then you may have to delete any indicators that you do not readily use and transfer them in later when you need them. Omega TradeStation allows room for only a limited number (200) of indicators/studies. The indicators supplied with the software allow you to quickly make pages that apply the Visual Pattern Designer Professional program on charting pages.

b.  If a Warning dialog appears saying, in effect, that you need to verify the indicators that you just added, dont worry we will do that. Click OK.

If you have installed a previous version of Visual Pattern Designer Professional a dialog box may appear indicating that any existing Visual Pattern Designer Professional User Functions, Studies or Systems will be overwritten during the installation. Click the Yes to all button to continue .

D. Stop! Don't be tempted to jump ahead with out reading the next sections. If the indicators are not verified or you do not load and unload the DLL according to the included directions during real-time data sessions then your computer system may hang up.

Select File, Open from the TradeStation Editor main menu bar.

From the Open dialog box, select Indicators and Click the OK button to continue.

Scroll down the Open Indicators dialog box to see the following default indicators that link data from TradeStation to the Visual Pattern Designer program. The contents of these indicators can be automatically generated from the main menu of VPDP. The new contents can be easily transferred in to the following default indicators by using the Power Editor transfer command. We will discuss this process after creating the example page. The following indicators have contents that match the example in this Getting Started Manual.

a. VPDP Export (User) -- exports data so you can begin to create patterns based on your own (user) selected prices and/or indicators from an Omega charting page to VPDP. The contents of an indicator, as you see here, can automatically be generated as text in the Notepad file I000.ASC by using the VPDP menu commands : Program, Generate exporting script, from user's choices.

b. VPDP Export (Pattern) -- exports existing patterns necessary for pattern edit and modification from an Omega charting page to VPDP. The contents of an indicator, as you see here, can automatically be generated as text in the Notepad file I002.ASC by using the VPDP menu commands: Program, Generate exporting script, from pattern.

c. VPDP Pattern Match - displays the closeness of match (proximity) of a pattern as compared to the pattern that exists in the current market condition. The contents of an indicator, as you see here, can automatically be generated as text in the Notepad file I001.ASC by using the VPDP menu commands : Program, Generate indicator, and selecting the saved pattern to follow.

Select these three indicators and click OK to open them in the Power Editor for viewing and verification.

Newer versions of TradeStation will automatically verify the systems that are transferred in. In the lower left corner of the Power Editor you should see the message 'Saved: Yes, Verified: Yes' for each system. If the system is not verified then select the system and click OK to open it in the Power Editor for viewing and verification. Select File, Verify from the main menu or use the function key (F3) to verify and save the system. A printout of each indicator is in Appendix section of this manual. You can exit the Power Editor when finished.

E. VPDP System is a trading system based on the closeness of match (proximity) of selected patterns calculated by VPDP pattern matching algorithms from the data exported from your Omega charting page. The contents of a system, as you see here, can automatically be generated as text in the Notepad file S000.ASC by using the VPDP menu commands: Program, Generate system, and selecting the saved patterns to determine buy and sell points.

F. Other Considerations:

Real time limitations of linking DLL's to TradeStation in Windows Windows programs keep track of every thing with 'messages' that are sent from program to program and window to window. When a computer is busy in a real-time environment, messages may be lost and the program will crash. You will find that this program is reasonably robust, however, here are the suggested procedures to help prevent problems with Windows General Protection errors due to the practical limitations of linking DLLs in real-time multi-tasking applications:

Turn off all Visual Pattern Designer Professional indicators by using the Analysis, Indicators, Status control, before closing any pages.

Turn off all Visual Pattern Designer Professional systems by using the Analysis, System, Status control, before closing any pages.

With the systems and indicators turned off, save each Visual Pattern Designer Professional page using the Page, Save menu items. Now the saved page is safe to open in the real-time server environment. Turn on the indicators that you need.

Never close a Charting page when the real-time Server is active and when the Visual Pattern Designer Professional program is active. Turn off the link to Visual Pattern Designer Professional program by closing the analysis in VPDP and then turning off the indicators and systems by using Analysis, Indicators, Status control.

If you ever get a Windows General Protection Fault, then you must exit and restart windows to prevent any future data and program errors, even though the program appears to be working.

Doing the majority of your new development with the off-line server and running only tested systems and indicators during market hours is the quicker and safer procedure. Windows 3.1 is not effective at realtime multitasking. Extensive mathematical calculations in real time can loose real-time market data.

Remember, you can export any charting data that you can see on a page by using the Tools, Show Chart Status window. Click on the Windows control button in the upper left corner of that window. Select Show all data, and Send to File You can now use the data in that file for other uses such as in a spreadsheet.

The installation process is complete and we are ready to create example pages that show how to find and recognize patterns. Please keep your original software disk(s) in a safe place in case you need to reinstall the Visual Pattern Designer Professional. The software should arrive with the program enabled for at least 30 days for your Omega Research product. You can double click on the VPD License 'key' icon to change the password. Telephone or write to Digital Enterprises, to receive the key to permanently enable your software, .

You have to create a page in order to connect Omega Research Charting data with the Visual Pattern Designer Professional program. The easiest way to do this is to create the example page that is detailed in this Getting Started Manual. This procedure will get you up and running very quickly. A complete listing of the supplied system and Indicators that match the examples in this Manual, are included in the Appendix for easy reference.

Chapter 3 Creating the Example Pages

In this chapter we will apply Visual Pattern Designer Professional different examples that give you a starting point for making and testing your own pattern recognition applications. The software tools are designed to work with any stock, index, or commodity data streams that can be displayed in TradeStation.

The following procedure uses the TradeStation Charting and Signal Server for this example. Similar steps can be applied to other servers or the SuperCharts program. Before you can begin using the Visual Pattern Designer Professional you need to have your Omega Research Server set up so that it can supply saved market data needed for the Omega Research Charting program. Contact Omega Research customer service for Charting program assistance. Contact your data vendor for historical data and a listing of the symbols used. Contact the exchanges for contract specifications.

This procedure will use intraday data of the S&P 500 cash Index ($SPX). The example pages use 10 days of 15 min. bars of data (260 bars), however, most any intra-day data stream with a sufficient number of data bars will work if you do not have S&P data.

I.  Double click on the Omega TradeStation Off-line Server icon in the Omega TradeStation Windows Group in order to run the Omega TradeStation Off-line Server program.

A.  Double click on the Omega TradeStation Charting icon in the Omega TradeStation Windows Group or press the F11 function key in order to run the Omega TradeStation Charting program.

If TradeStation Charting is about to open pages or create new windows then click No to continue.

Select Page, New from the TradeStation Charting main menu bar.

Enter an new Page name such as : VPDP Example 1

Click OK to continue.

B.  Now we will add the data to the chart.

Select Window from the TradeStation Charting main menu bar.

Select New.., Chart, Click OK to continue.

From the data dialog box enter market data stream that you want to evaluate and test.

C.  In this Example we are using the Data Format: Signal

Load: $SPX , for the S&P 500 Index

Select: Data Compression : Intra-day 15 min., Days back 10

Note: You will need a minimum of 50 bars of data to see most indicators. This example has 260 bars of data .

Click OK twice to continue.

D.  You should now see a chart of data bars of the market data charted in subgraph1.

Adjust the bar spacing for your preference by selecting Chart, Bar spacing , and entering the desired spacing.

Select Page, Save to save your page for future reference

E.  We are now ready to add the first indicator VPDP Export(User) that can send charting data to the Visual Pattern Designer Professional program.

Select Analysis, Indicator from the TradeStation Charting main menu bar.

Select Add... and Scroll down the indicators dialog box

Select the new indicator named VPDP Export(User)

Click Add to continue.

In the Indicators Dialog Box verify that Status = On for this indicator.

Click OK to continue.

You should see the plot of this VPDP exporting indicator in Subgraph 2 which allows you to create new pattern matching indicators from your choice of Omega data streams or charting indicators.

You do not need to plot a regular Omega Charting indicator in order to transfer it to the VPDP program . However, you may want to add it on a charting page in order to visualize your trading ideas. This example uses the built-in functions : Average, OBV and Volatility.

F.  Adjust the size of the Omega Charting program window by clicking on the upper right hand window sizing buttons and adjusting the borders. We will want to be able to easily switch back and forth between the Omega Charting window and the Visual Pattern Designer main window.

II. Run the Visual Pattern Designer Professional program by double clicking on the Visual Pattern Designer Professional icon in the Visual Pattern Designer Professional program group. You should now see the Visual Pattern Designer Professional main window. Adjust the size of the VPDP program window by clicking on the upper right hand window sizing buttons and adjusting the borders.

A.  For on-line help with Visual Pattern Designer Professional. Click Help

B.  From the VPDP main menu select File, New A new window titled 'Example' with the data from the Charting page will appear.

Use the main menu or the icon menu bar Stretch and Squeeze icons to adjust the number and scale of bars of data in the 'Example' window to see all bars of data for this chart. You have just automatically linked the Visual Pattern Designer Professional program directly to you Omega Research Charting prorgram by just adding an indicator.

C.  Now we will see how to select bars of data, see where they match other bars, and save that pattern for later use. In all of these examples we will be using the right mouse button to bring up the floating Chart / Pattern menu. These duplicate commands can be executed from the main menu or from the icon menu bar buttons.

First, move the mouse to the 'Example' titled window.

Drag the mouse over three bars, and release the right mouse button. Three of the bars should be shaded gold.

With the mouse still in this window titled 'Example', click the right mouse button.

Select Pattern, Define from selected range from this menu. You will see the highs and lows connected together with a line used in the comparison pair matching method. See the User's Manual for a detailed description on the different matching techniques. As a generalization, you will probably use the comparison method for short patterns, such as this one, while you will use the more sophisticated method of point relevance for complex patterns such as market trends with retracements.

With the mouse still in the window titled 'Example', click the right mouse button.

Select Pattern, Find matches.

Select Best match and Number of patterns to look for: 3. Click OK.

The 'Example' window should now show 4 shadowed sets of bars

a.  Gray - your original selected pattern

b.  Gold - the best match to the original pattern

c.  Blue - the other two matching patterns.

Select the Pattern, Find ( first, previous, next or last ) match menu commands or the icon menu bar buttons of the same function to watch the selected gold area jump to the bars with the best match, the next best match and finally to the worst match.

If you want to save this pattern for future use Select Pattern, Save and enter an appropriate DOS file name. For example MYFIRST.PTN and Click OK.

D.  To view the charting indicators and price data information that is being sent to VPDP for pattern analysis in this particular example exporting indicator, split the 'Example' window into four panes as described in the User's Manual. To do this you will drag the small bars at the end of to the Windows Vertical and Horizontal scroll bars toward the center of the window.

You should now see four panes of the price bar data.

Move the mouse to the upper left quadrant window.

With the mouse in this window pane, click the right mouse button. Select Chart, Synchronize to synchronize all panes to this view.

E.  Move the mouse to the upper right quadrant window.

With the mouse in this window pane, click the right mouse button. Select Chart, Select plots...

Select any highlighted 'Open, High, Low, Close' entry to deselect them as a group.

Select and highlight Volume.

Click the Close control button. Observe the graph of Volume data that has been exported to VPDP by the VPDP Export indicator.

F.  Move the mouse to the lower left quadrant window.

With the mouse in this window pane, click the right mouse button. Select Chart, Select plots...

Select any highlighted Open, High, Low, Close entry to deselect them as a group.

Select and highlight Average.

Click the Close control button. Now observe the graph of ten bar moving Average data that has been exported to VPDP by the VPDP Export indicator.

G.  Move the mouse to the lower right quadrant window.

With the mouse in this window pane, click the right mouse button. Select Chart, Select plots...

Select any highlighted 'Open, High, Low, Close' entry to deselect them as a group.

Select and highlight Volatility.

Click the Close control button. Now observe the fourteen bar Volatility data that has been exported to VPDP by the VPDP Export indicator.

H.  To define an exporting indicator with the indicators and data streams that you want, you will use the menu selections Program, Generate exporting script, from user's choices to select or enter the indicators of your choice.

I.  Close this 'Example' window.

Select Analysis, Indicator from the Charting main menu bar.

From the Indicator Dialog Box, set Options Status = Off for any VPDP indicators on this page by selecting the indicator and then using the Status button

Select Add... and Scroll down the indicators dialog box

Select the new indicator named VPDP Export(Pattern)

Click Add to continue.

In the Indicators Dialog Box verify that Status = On for this indicator.

Click OK to continue.

You should see the plot of this VPDP exporting indicator in Subgraph 2 which allows you to edit indicators from patterns that you have previously created for Omega data streams or charting indicators.

Switch back to the VPDP program. Select File, New. Select the chart name 'INSIDE-78477407'. Click OK

Select Pattern, Load and select INSIDE.PTN. Click OK.

Select Pattern, Find matches. As in the last example, view the matches of this saved pattern to price and indicator data to current data.

J.  You can select Pattern, Edit matching options or Modify to change matching parameters. You will have to modify the matching properties in the 'Comparison Pairs' or 'VQ scaling options' dialog boxes if you want to include the indicator patterns in you match. See the User's Manual section on 'Designing a pattern' for specific details on matching methods.

Select Analysis, Indicator from the TradeStation Charting main menu bar.

From the Indicator Dialog Box, set Options Status = Off for any VPDP indicators on this page by selecting the indicator and then using the Status button

Select Add and Scroll down the indicators dialog box

Select the new indicator named VPDP Pattern Match

Click Add to continue.

In the Indicators Dialog Box verify that Status = On for this indicator

Click OK to continue.

You should see the plot of this VPDP exporting indicator in Subgraph 2 which allows you to track the proximity of a pattern match from patterns that you have previously created.

K.  If you get an error message, check to see that the directory path in the example indicator matches the directory path to the saved patterns for your installation of VPDP. Example C:VPDINSIDE.PTN.

Select Analysis, System from the TradeStation Charting main menu bar.

Select Add and Scroll down the indicators dialog box

Select the new system named VPDP System

Click Add to continue.

In the System Dialog Box verify that Status = On for this system.

Click OK to continue.

You should see a trading system applied to the market data with long and short entries and exits based on the proximity of pattern matches from patterns that have been previously designed and saved. You can adjust the proximity levels at the entry and exit points by changing the system input values

If you get an error message, check to see that the directory path in the example system matches the directory path to the saved patterns for your installation of VPDP. Example C:VPDINSIDE.PTN.

III. Congratulations, you have successfully created indicators and a system based on pattern recognition without writing any complex EasyLanguage computer programs.
Chapter 4 Applications

I. Developing your own custom applications.

A.  The example indicators and system were created automatically using the Program, Generate selections from the VPDP main menu. You can make changes to your pattern recognition work and then re-issue a 'Generate' menu command, to automatically generate script (i.e. EasyLanguage computer code) in the Windows Notepad Editor for an VPDP exporting or matching indicator or system of your design .

For example, to create a new 'VPDP Pattern Match' tracking indicator, select Program, Generate indicator from the VPDP main menu.

Select a saved pattern e.g. dbltop.ptn and click OK. The text is automatically generated. It is saved and displayed in the Notepad Editor as file I001.ASC.

From the TradeStation Power Editor select Utilities, Transfer and enter the Source and target directory information. For the default installations of VPDP and TradeStation version 3.5 enter

a.  From: C:VPS

b.  To: C:OMEGATS

Select Yes to overwrite the existing indicator 'VPDP Pattern Match'.

B.  In order to permanently retain the indicators or systems of your own design, use the TradeStation Power Editor File, Save as menu commands to create new indicators or system with a new name. Verify using the File, Verify command or F3. For example, open the default system named 'VPDP System' and save it as 'My system 1'

C.  For an alternate method to create indicators, Power Editor users can use the Windows clipboard to Copy text from the Notepad Editor and Paste the text to a previously created empty TradeStation Indicator.

II. Using Visual Pattern Designer Professional with SuperCharts

A.  VPDP includes the default Indicators 'VPDP Export(User)', 'VPDP Export (Pattern)' and 'VPDP Pattern Match' and the default system 'VPDP System' as the destination for the automatically generated script from VPDP. SuperCharts users do not have access to the TradeStation Power Editor to ease the job of creating and modifying new systems or indicators. Your new VPDP scripts can only be automatically transferred to these default indicators and system for SuperCharts. If you want the ease and convenience of using the File, Save as.. commands that are found in the Power Editor, then you should consider upgrading your SuperCharts program to an off-line version of TradeStation.

Here is a non-supported work-around that is not convenient but does work for SuperCharts.

Create a special separate directory for this procedure on you disk drive using the windows File Manager. For example create C:SCTEMP

Create a system or indicator of your own name using the SuperCharts Quick Editor. For Example : Export(User)1

Transfer the indicator that you just created to the new special directory using the Editor Transfer command.

Create a new system or indicator from VPDP using the Program, generate menu commands.

Overwrite the I0000.ASC, I0001.ASC, I0002.ASC, or S0000.ASC in the special directory, as seen in the NotePad Editor, with the ASC file created by VPDP.

Transfer your new indicator in the special directory back into SuperCharts using the Editor Transfer command.

B. Consider upgrading to TradeStation with the Power Editor. The indicators that you create with the power editor can be use with SuperCharts.
APPENDIX

Printout of Example Indicators and System

I. Indicator VPDP Export(User)

This indicator exports user selected price data in data1 ( O, H, L, C, Volume, Open Interest, Upticks and DownTicks are transferred for intra-day price streams ) and indicator data that we had selected for this example ( Moving Average, OBV, and Volatility ) from an Omega charting page to VPDP. You do not need to plot the indicator data in order to transfer it to VPDP, but it is nice to graphically see it on a charting page in order to visualize your trading ideas. The contents of an indicator, as you see here, can automatically be generated as text in the Notepad file C:VPDI000.ASC by using the VPDP menu commands: Program, Generate exporting script, from user's choices.

Vars: OK(0),

Handle(0);

Array: VPDI[3](0);

DefineDllFunc:'VPDVPD2_TS.DLL',INT,'InitVPD2',LPSTR,LONG,INT;

DefineDllFunc:'VPDVPD2_TS.DLL',BOOL,'ExportVPD2',INT,LPLONG,LPLONG,

LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPINT,LPFLOAT,

WORD,WORD;

DefineDllFunc:'VPDVPD2_TS.DLL',BOOL,'NameStream',INT,INT,LPSTR,LPSTR;

IF CurrentBar = MaxBarsBack THEN BEGIN

OK = EnableVPD;

Handle = InitVPD2('Example',PriceScale,3);

NameStream(Handle, 0, 'Average', 'Average(Close,10)');

NameStream(Handle, 1, 'OBV', 'OBV');

NameStream(Handle, 2, 'Volatility', 'Volatility(14)');

END;

IF CurrentBar >= MaxBarsBack THEN BEGIN

OK = EnableVPD;

VPDI[0] = Average(Close,10);

VPDI[1] = OBV;

VPDI[2] = Volatility(14);

ExportVPD2(Handle,&Open,&High,&Low,&Close,&Volume,&OpenInt,&UpTicks,&DownTicks,&Date,&Time,&VPDI[0],ArrayStartAddr(VPDI),ArraySize(VPDI));

Plot1(Close,'Close');

END;

II. Indicator VPDP Export(Pattern)

This indicator exports existing patterns necessary for pattern edit from an Omega charting page to VPDP. The contents of an indicator, as you see here, can automatically be generated as text in the Notepad file C:VPDI002.ASC by using the VPDP menu commands: Program, Generate exporting script, from pattern and entering a name of the pattern you have already defined and saved.

Vars: BarNum(0),

OK(0),

Handle(0);

Array: VPDI[3](0);

DefineDllFunc:'VPDVPD2_TS.DLL',INT,'InitVPD2',LPSTR,LONG,INT;

DefineDllFunc:'VPDVPD2_TS.DLL',BOOL,'ExportVPD2',INT,LPLONG,LPLONG,

LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPINT,LPFLOAT,

WORD,WORD;

DefineDllFunc:'VPDVPD2_TS.DLL',BOOL,'NameStream',INT,INT,LPSTR,LPSTR;

DefineDllFunc:'VPDVPD2_TS.DLL',FLOAT,'PatternMatch2',INT,LPSTR,INT;

IF CurrentBar = MaxBarsBack THEN BEGIN

OK = EnableVPD;

Handle = InitVPD2('INSIDE-784477407',PriceScale,3);

NameStream(Handle, 0, 'Average', 'Average(Close,10)');

NameStream(Handle, 1, 'OBV', 'OBV');

NameStream(Handle, 2, 'Volatility', 'Volatility(14)');

END;

IF CurrentBar >= MaxBarsBack THEN BEGIN

OK = EnableVPD;

VPDI[0] = Average(Close,10);

VPDI[1] = OBV;

VPDI[2] = Volatility(14);

ExportVPD2(Handle,&Open,&High,&Low,&Close,&Volume,&OpenInt,&UpTicks,

&DownTicks,&Date,&Time,&VPDI[0],ArrayStartAddr(VPDI),ArraySize(VPDI));

Plot1(Close,'Close');

END;

III. Indicator VPDP Patern Match

This indicator displays the closeness of match ( proximity ) of a pattern ( INSIDE.PTN) as compared to the pattern that exists in the current market condition. The contents of an indicator, as you see here, can automatically be generated as text in the Notepad file C:VPDI001.ASC by using the VPDP menu commands : Program, Generate indicator, and selecting a saved pattern to trach bar-by-bar proximity values.

Vars: BarNum(0),

OK(0),

Handle(0);

Array: VPDI[3](0);

DefineDllFunc:'VPDVPD2_TS.DLL',INT,'InitVPD2',LPSTR,LONG,INT;

DefineDllFunc:'VPDVPD2_TS.DLL',BOOL,'ExportVPD2',INT,LPLONG,LPLONG,

LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPINT,LPFLOAT,

WORD,WORD;

DefineDllFunc:'VPDVPD2_TS.DLL',BOOL,'NameStream',INT,INT,LPSTR,LPSTR;

DefineDllFunc:'VPDVPD2_TS.DLL',FLOAT,'PatternMatch2',INT,LPSTR,INT;

IF CurrentBar = MaxBarsBack THEN BEGIN

OK = EnableVPD;

Handle = InitVPD2('INSIDE-784477553',PriceScale,3);

NameStream(Handle, 0, 'Average', 'Average(Close,10)');

NameStream(Handle, 1, 'OBV', 'OBV');

NameStream(Handle, 2, 'Volatility', 'Volatility(14)');

END;

IF CurrentBar > MaxBarsBack THEN BEGIN

BarNum = BarNum[1]+1;

END;

IF CurrentBar >= MaxBarsBack THEN BEGIN

OK = EnableVPD;

VPDI[0] = Average(Close,10);

VPDI[1] = OBV;

VPDI[2] = Volatility(14);

ExportVPD2(Handle,&Open,&High,&Low,&Close,&Volume,&OpenInt,&UpTicks,

&DownTicks,&Date,&Time,&VPDI[0],ArrayStartAddr(VPDI),ArraySize(VPDI));

END;

IF CurrentBar >= MaxBarsBack+2 THEN BEGIN

Plot1(PatternMatch2(Handle,'C:VPDINSIDE.PTN',BarNum),'PMatch');

END;

IV. System : VPDP System

This trading system based on the closeness of match ( proximity ) of selected patterns of prices and indicators is calculated by VPDP pattern matching algorithms from the data exported from your Omega charting page. The contents of this system was automatically be generated as text in the Notepad file C:VPDS000.ASC by using the VPDP menu commands: Program, Generate system. You can easily select up to any three different patterns as conditions for entering or exiting the market long or short by selecting saved patterns.

Inputs:

BuyProx1(0.000000),

BuyProx2(0.000000),

ELProx1(0.000000),

ELProx2(0.000000);

Vars:

BarNum(0),

OK(0);

Vars: HdlBP1(0);

Array: IBP1[3](0);

Vars: HdlBP2(0);

Array: IBP2[3](0);

Vars: HdlELP1(0);

Array: IELP1[3](0);

Vars: HdlELP2(0);

Array: IELP2[3](0);

DefineDllFunc:'VPDVPD2_TS.DLL',INT,'InitVPD2',LPSTR,LONG,INT;

DefineDllFunc:'VPDVPD2_TS.DLL',BOOL,'ExportVPD2',INT,LPLONG,LPLONG,

LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPINT,LPFLOAT,

WORD,WORD;

DefineDllFunc:'VPDVPD2_TS.DLL',BOOL,'NameStream',INT,INT,LPSTR,LPSTR;

DefineDllFunc:'VPDVPD2_TS.DLL',FLOAT,'PatternMatch2',INT,LPSTR,INT;

IF CurrentBar > MaxBarsBack THEN BEGIN

BarNum = BarNum[1]+1;

END;

IF CurrentBar = MaxBarsBack THEN BEGIN

OK = EnableVPD;

HdlBP1 = InitVPD2('(Untitled)-784477865-B1',PriceScale,3);

NameStream(HdlBP1, 0, 'Average', 'Average(Close,10)');

NameStream(HdlBP1, 1, 'OBV', 'OBV');

NameStream(HdlBP1, 2, 'Volatility', 'Volatility(14)');

OK = EnableVPD;

HdlBP2 = InitVPD2('(Untitled)-784477865-B2',PriceScale,3);

NameStream(HdlBP2, 0, 'Average', 'Average(Close,10)');

NameStream(HdlBP2, 1, 'OBV', 'OBV');

NameStream(HdlBP2, 2, 'Volatility', 'Volatility(14)');

OK = EnableVPD;

HdlELP1 = InitVPD2('(Untitled)-784477865-EL1',PriceScale,3);

NameStream(HdlELP1, 0, 'Average', 'Average(Close,10)');

NameStream(HdlELP1, 1, 'OBV', 'OBV');

NameStream(HdlELP1, 2, 'Volatility', 'Volatility(14)');

OK = EnableVPD;

HdlELP2 = InitVPD2('(Untitled)-784477865-EL2',PriceScale,3);

NameStream(HdlELP2, 0, 'Average', 'Average(Close,10)');

NameStream(HdlELP2, 1, 'OBV', 'OBV');

NameStream(HdlELP2, 2, 'Volatility', 'Volatility(14)');

END;

IF CurrentBar >= MaxBarsBack THEN BEGIN

OK = EnableVPD;

IBP1[0] = Average(Close,10);

IBP1[1] = OBV;

IBP1[2] = Volatility(14);

ExportVPD2(HdlBP1,&Open,&High,&Low,&Close,&Volume,&OpenInt,&UpTicks,

&DownTicks,&Date,&Time,&IBP1[0],ArrayStartAddr(IBP1),ArraySize(IBP1));

OK = EnableVPD;

IBP2[0] = Average(Close,10);

IBP2[1] = OBV;

IBP2[2] = Volatility(14);

ExportVPD2(HdlBP2,&Open,&High,&Low,&Close,&Volume,&OpenInt,&UpTicks,

&DownTicks,&Date,&Time,&IBP2[0],ArrayStartAddr(IBP2),ArraySize(IBP2));

OK = EnableVPD;

IELP1[0] = Average(Close,10);

IELP1[1] = OBV;

IELP1[2] = Volatility(14);

ExportVPD2(HdlELP1,&Open,&High,&Low,&Close,&Volume,&OpenInt,&UpTicks,

&DownTicks,&Date,&Time,&IELP1[0],ArrayStartAddr(IELP1),ArraySize(IELP1));

OK = EnableVPD;

IELP2[0] = Average(Close,10);

IELP2[1] = OBV;

IELP2[2] = Volatility(14);

ExportVPD2(HdlELP2,&Open,&High,&Low,&Close,&Volume,&OpenInt,&UpTicks,

&DownTicks,&Date,&Time,&IELP2[0],ArrayStartAddr(IELP2),ArraySize(IELP2));

END;

IF CurrentBar >= MaxBarsBack+2

THEN BEGIN

IF (PatternMatch2(HdlBP1,'C:VPDGAPDN.PTN',BarNum) <= BuyProx1) OR

(PatternMatch2(HdlBP2,'C:VPDGAPOPNDN.PTN',BarNum) <=BuyProx2)

THEN Buy;

IF (PatternMatch2(HdlELP1,'C:VPDGAPUP.PTN',BarNum) <= ELProx1) OR

(PatternMatch2(HdlELP2,'C:VPDGAPOPNUP.PTN',BarNum) <=ELProx2)

THEN ExitLong;

END;

Visual Pattern Designer

Professional

User's Manual

Copyright notice

No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any human or computer language, in any form or by any means, without the express written permission of Digital Enterprises, Ltd., PO Box 130440, Ann Arbor, MI 48113-0440.

Trademarks

TradeStation and SuperCharts are trademarks of Omega Research Inc. Windows is a trademark of Microsoft Inc.

Author

Jordan Stojanovski

What is Visual Pattern Designer

Let me tell you a story. I am a computer programmer and a few years ago I was working for a company that was involved in trading with securities. One day we got this wonderful charting software package, that not only had real time charts, but it also allowed the users to design their own market indicators and trading systems. It contained a simple programming language in which you could write your own miracles. I was so excited about it that after a week I knew my way around most of its commands. I bragged to my boss about the abilities of the new charting package a lot.

- Give me five minutes and I'll have your favorite trading system programmed and tested, I was claiming.

- O.K., he said, write this one: buy when a 'head and shoulders' pattern is encountered. Sell on the mirror image of that pattern. Let's see what that system does.

- Youve got to be more specific, I said. You can buy when the high is greater than the previous high, or something like that, but 'head and shoulders' is a very vague term.

He took a piece of paper, and drew a few bars on it.

- That's head and shoulders. Let's see how it performs, he said.

- Wait a minute. What if I move this bar up a little bit. Is that a 'head and shoulders' too?, I said, while modifying his drawing a little bit.

- Aha.

- And this, too?, I put another scribble on the paper.

- Sure, he said.

After an hour I was frustrated, and he still did not have his 'head and shoulders' programmed. We killed the whole day together for me to understand what exactly (if there was such a thing) he meant by 'head and shoulders'. A week later, he was still not happy with my implementation of 'head and shoulders'. The next week I was working on a pattern called 'diamond'. It was even worse. By the time I got versed in fulfilling his requests, the software package started complaining that I had exceeded the maximal allowed program length (about 2 pages, by the way). By that time my boss was having serious doubts about my programming abilities.

I am daydreaming while writing this story. If a man from the future had come to town when I was writing that 'head and shoulders' program, and asked me if I wanted him to bring me something from 1994, I should have said, Bring me a copy of Visual Pattern Designer. It would have saved my job. Good pay, too.

When I claimed 'Give me a few minutes and you will have your system', if I had had Visual Pattern Designer, I would not have been lying to my boss. It allows me to pick a pattern from any chart, modify it a little bit, and search for approximate matches throughout years of data. It conveniently displays the outcome from the matching patterns, so I can see if my pattern is any good right away. Once I like the pattern, I can save it and use it in the future. I can incorporate the pattern I designed into my trading systems (programs) without having to spend that week programming.

Disclaimer: We are not responsible if you get addicted to Visual Pattern Designer.

What does the Professional add to it?

Since our release of the first version of Visual Pattern Designer, we followed a lot of suggestions from our users. Some wanted to see the patterns in a chart. Some needed a simpler way to edit a pattern, and some suggested other simplifications of the user interface. Everything we found reasonable we put in the professional edition, but that is still not a reason to call it professional and charge more money for it. Here is a question that we could not answer with the first version of Visual Pattern Designer:

- Can I have a pattern that defines a relationship between the High and its moving average?

- Yes and no - we said. The moving average is only a derivation of the price itself. Just find the desired situation in a chart. That is your pattern.

- What If I cant find it.

- It may be an inconsistent situation if you cant find it. - we &^%%$#!@-ed our way out of it.

That went O.K., but check this one out:

- Can I define a pattern that relates two different markets?

We had to answer this question in a Professional manner: Visual Pattern Designer Professional will be able to do that. - We would say.

Visual Pattern Designer came with a few Easy Language scripts that the users could run in order to make it communicate to TradeStation or SuperCharts. For the Professional version these scripts had to be rewritten every time the user changed the choice of indicators. The user would not want to do this. So who else but Visual Pattern Designer Professional had to learn how to do write programs in Easy Language. I admit, we got carried away with this idea, but now you can develop complex trading systems without writing a single line of Easy Language code. You will barely touch the keyboard when using Visual Pattern Designer Professional. All you have to do is pick choices and draw market situations with your mouse. Will these systems be inferior to the ones programmed by typing? No, quite the opposite, Visual Pattern Designer uses matching methods that cannot be programmed in thousands of lines in Easy Language. A lot more than the maximum allowed. We can do it because Visual Pattern Designer Professional calls external programs written in C++. They run a lot faster, too.

Installation

The installation of Visual Pattern Designer consists of two stages:

Installation of Visual Pattern Designer files. Put the Visual Pattern Designer diskette in drive a: and from File Manager or Program Manager select the option Run from the File menu. The following dialog box pops up:

Type:

A:SETUP

as shown and push the OK button. The installation will proceed with the following dialog box:

Type the path in which you wish to install Visual Pattern Designer[1]. Push the OK button again. It is recommended that you install the software in the suggested directory on the disk drive where TradeStation or SuperCharts is installed. For example, if you have your copy of TradeStation installed on the D drive, type in:

D:VPD

In about a minute this step will be complete.

Finally, you need to install the sample programs that run Visual Pattern Designer with Omega TradeStation or SuperCharts. This step needs to be done manually, since there is no automated way to transfer TradeStation or SuperCharts indicators, user functions and systems. The transfer can be made either from TradeStation Charting, SuperCharts or from TradeStation Power Editor. Invoke the Transfer option from the Editor menu. The following dialog box pops up:

If you have TradeStation installed on the C drive fill in the appropriate edit boxes as shown above and push OK. If you have SuperCharts installed on the C drive then depending type the appropriate destination in the To: edit box. This is typically:

C:OMEGASC for version 2.1 and up.

C:SC for version 2.1.

If you are installing Visual Pattern Designer Professional to work with FutureSource Professional the destination is:

C:FSP

Note that TradeStation or SuperCharts may complain at this point if your version of TradeStation or SuperCharts is different from the version on which these samples have been developed. It will also inform you that you have to transfer the user functions separately. In such a case, choose to continue and ignore the warnings. When you want to use the samples you will notice that they are not verified. The easiest way to verify them, is to choose the Verify All option from the Quick Editor menu in TradeStation Charting or SuperCharts.

This completes the installation of Visual Pattern Designer.

First start

If you go to Program Manager and try to run Visual Pattern Designer Professional (we will call it VPD from now on), by double-clicking on its icon, the following will pop up:

Almost all menu selections and buttons are disabled until you create a new page. For this purpose you need to select New from the File menu, or just click the button that is circled in the above picture. The following comes up:

This is because VPD needs to read data from TradeStation or SuperCharts. You must run TradeStation or SuperCharts at the same time for this purpose. The simplest way to get it going is to follow the directions in the dialog box above. After that, minimize TradeStation or SuperCharts by clicking on its down arrow button in the top right corner. Minimize it, but please dont close it. VPD runs in conjunction with TradeStation or SuperCharts and it cannot run alone. Later on we will see that we can customize the exported data without programming. Back to VPD; lets open a new page after starting the indicator VPD Example (User):

If you post more than one such indicator in TradeStation or SuperCharts, here is what you will see:

Select one of the available charts with the mouse and push OK, or just double click on one of them to start a page. This is the list of charts exported from TradeStation to VPD. To export a chart you must activate an indicator in TradeStation that does that. There are three examples on the Visual Pattern Designer Professional diskette. Their names start with VPDP.

Warning: When you are finished with your Visual Pattern Designer Professional session you must first close Visual Pattern Designer Professional , and then remove the calling indicator or system (VPD Example (User) in this case). If you remove the page with the indicator first, Windows may lose stability and you may need to reboot your computer. This occurs because TradeStation and SuperCharts provide no function to notify the calling DLLs of calling indicators or systems removal.

Warning: Never turn on the same indicator or system that uses Visual Pattern Designer Professional more than once at the same time. This can cause TradeStation or SuperCharts to crash. If you need the same indicator or system in more than one TradeStation or SuperCharts window, then generate the same indicator or system twice using the selections from the Program menu in Visual Pattern Designer Professional. In TradeStation this is not a problem, but in SuperCharts, because you do not have a Power Editor, you may have to paste the generated indicators or systems in the appropriate .ASC files and then verify them again. For more details see the box Transferring the programs generated by VPD that you can find towards the end of this manual.

The VPD window

All buttons on the toolbars correspond to menu selections. VPD could be used without those buttons. They are there only to make your life easier.

To find out what a button does, just push on it with the left mouse button. Dont release the mouse button! Read the text on the status bar, then move the mouse pointer away from the button and then release the mouse button. Same as in any standard windows application. Same thing with the menus. As you move the mouse around the menu bar with the left mouse button pressed, you get a description for each menu selection. Here is where you read the description:

In the status bar there are 5 fields:

Their purpose is the following:

Description of the button or menu selected.

Date and time of the point in the chart indicated by the mouse pointer.

Price or value of the indicator at the mouse pointer.

Rank of the current pattern match. When you search for pattern matches, all matches are displayed, and as you switch between them, you see which one is the best match, which one is second, etc.

Proximity of the current pattern match. This tells how good the match is.

Dont worry if you dont understand the last two. They will become clear when we get to pattern matching.

Visual Pattern Designer Professional is a so-called MDI Windows application. That means that within the main window, you can open several windows. Each one of those sub-windows can be minimized, restored or maximized. When they are minimized they show as icons inside the main window (as opposed to icons on the desktop window). When they are maximized, they occupy the whole main window and not the whole desktop window. This keeps the VPD stuff organized. Other MDI Windows applications are Program Manager and File Manager, while Notepad is not. As in any other MDI application, to start a new document as it is usually called, just select New from the File menu. In VPD this means that a new page will be created. The data source for that page will be imported from TradeStation. The data source can contain the prices, volume and any other market indicator. The data source is exported from TradeStation by posting a special TradeStation indicator in a TradeStation window. That indicator specifies what is exported. Later in this manual you will learn how to get VPD to generate such exporting indicators, so you dont have to write them yourself. Each VPD page can have a pattern in it. It would be quite inconvenient if we had to start drawing patterns from scratch. VPD lets you pick a pattern from the charts. First you need to mark part of the chart with the mouse. You can select such a range by pushing the left mouse button and dragging it across the desired part of the chart. Just like marking text in any word processor. The marked range will show up in different background color:

To convert the marked range into a pattern, select Define from selected range from the Pattern menu, or push this button:


Here is what you get:

You will learn more about editing patterns in a separate chapter in this manual. Lets go back to the MDI windows. You can open another page from the same data source by selecting New from the File menu, but the pattern will not be in the new page. On the other hand you can open another view of the same page by selecting New Window from the Window menu. Everything you do in one view will show up in the other one immediately. This lets you see and compare two different parts of a chart, while viewing both of them at the same time. There is an even neater way of doing this. You can split a window by dragging the splitter thumbs with your mouse. There are two of them:

Here is what happens when we drag the vertical splitter thumb:

Now you can scroll each window separately. If you get lost while scrolling, there are three ways to find out where you are:

As you drag the mouse across the windows, look at the time and date displayed on the status bar at the bottom of the main window.

The scroll bars below each window show the position of the window relative to the whole data series.

You can position different views to show the same part of the data series by using the Synchronize selections from the Chart menu. There is no point in explaining each one of them, feel free to try them. The word pane, by the way means a section of the splitter window.

If you havent noticed so far, you dont have to go to the menu bar to select menu options. Some of the menu options are available by clicking the right mouse button inside any view. You may find this useful or, at least, fashionable.

Lets split our window again, this time horizontally, and maximize it by pushing on the button in its top right corner:

Now we can click in any pane and then select Select plots from the Chart menu. Then we can choose to plot different things:

This time we selected Open High Low Close and Average(C,14). For each one of them we can select additional options by clicking the right mouse button on any of the listed items. The menu offers different kinds of plots and different colors. The selection that you pick applies only to the item that you right-clicked. After selecting candlesticks for the Open, High, Low and Close and clicking on Average(C,14), by using the left mouse button, we can see this:

Let us click again on the pane below it, and select Volume in it:

The Volume by default is displayed in a 0-Bar chart - vertical bars from 0 to the of the Volume amount, for each time period:

There are a few more things that would make this manual boring. Instead, just try them yourself and see what happens. These are the Help menu, the View menu and the Stretch and Squeeze selections from the Chart menu. Try clicking these buttons, as well:


The button for synchronization aligns all panes in the current window:


It does the same as selecting Synchronize all panes from the Chart menu.

The following button or the selection of Switch to charting program from the Program menu, switches the focus to TradeStation or SuperCharts and maximizes its main window:

To go back to VPD, just minimize TradeStation or SuperCharts.

Designing a pattern

Let us begin by selecting a range using the mouse and converting it into a pattern by selecting Define from selected range from the Pattern menu, or by clicking on the following button:


Then we see the following:

We can change the pattern matching method by selecting Edit matching options from the Pattern menu, or clicking on the following button:


Then we check the Vector Quantization matching mode and push close in the dialog box that shows up:

The pattern will be displayed differently (the reason for this will be apparent later on):

There are two matching methods available in Visual Pattern Designer Professional:

Order matching, in which the order of different pairs of points matters. Each pair of points that has to be compared is connected with a solid line. These lines can be placed between any two points in the pattern by the user. Initially all consecutive Highs and all consecutive Lows are connected, since this is the most frequent desire. This matching method is the usual one.

Vector Quantization is a sophisticated matching method suitable for matching large patterns. It concentrates on the general shape of the pattern instead of on details. This method was adapted to market pattern matching by Digital Enterprises, Ltd. We borrowed the idea from Neural Networks and Voice Recognition. In this method the pattern is signified by its relevant points, which are marked with circles. The pattern is overlaid over the potential match, after appropriate stretching and moving. Then the mismatch at the relevant points determines the proximity (goodness) of the match. Any point in the pattern can be marked as relevant or irrelevant by the user.

At this point we will be interested in changing the shape of the pattern. Different modifications can be made on selected parts of the pattern. These parts are selected by dragging across them with the mouse to mark a region. To mark just one bar, you can just double-click with the left mouse button on it. Lets just do that:

Then we can modify parts of that bar. For example, lets move the High a little higher. Select Modify from the Pattern menu or click here:


Then select High as follows:

When we click on the OK button, the cursor will change its shape, letting us know that we can select a value. Place the cursor at the desired value and click with the left mouse button there:

We just moved up the High of the selected bar. We can also modify a group of points together. Usually we need to line up a few values. We will do this with the Volume this time. Click in the Volume pane and then select a range as shown in this picture:

Then select Lineup from the Pattern menu or click the following button:

Then select Volume:

All values of the Volume will line up between the first and the last value in the selected range:

Point Order matching

Let us change the matching method of the pattern back to Order by selecting Edit matching options from the Pattern menu. Let us edit the comparison pairs. First we will remove the comparison pairs between all consecutive pairs of Highs in the pattern. For that we will select the whole pattern by dragging the mouse across the pattern while the left mouse is pressed:

To remove the comparison pairs, we will select Comparison pairs from the Pattern menu, or push this button:


Then we fill up the dialog box that pops up as follows:

Note that the lines between all consecutive highs disappear (try this, the reason for it will become apparent in a few pages):

Let us do the same thing with the Lows. Then let us compare the moving average against the close in each bar:

Note the tiny lines that appear between each point of the Moving average and the Close:

We can set comparison pairs between any two points, as long as they are on the same view. If they are not - we would have to use Select plots from the Chart menu to select both in the same view.

Now let us mark the Volume bars as shown:

Let us set a comparison pair between the first and the last in the selected region:

We get the following picture:

What if we want the Volume of the first bar in the pattern to be lower than the third bar by 15000? We select the first three bars with the mouse and then set the comparison pairs again, putting 15000 in the Required difference box:

The line between the two volumes is now broken in two parts; the first going straight up 15000 notches and the second going to the third volume bar:

Let us now step back and see what a comparison pair means. Let us use a simple Inside Bar pattern to demonstrate the Order matching.

The last High is higher than the first High and the last Low is lower than the first Low. If we try to match this pattern against another one we will get a number called Proximity that tells how close the match is. Proximity 0 means a perfect match. In other words, in the pattern we are trying to match against this one the last High has to be higher than the first High and the last Low has to be lower than the first Low. For every one of these conditions that fails to be satisfied the proximity goes up by one. For example, if the last High is higher than the first High and the last Low is not lower than the first low, then the Proximity would be 1.

What if we were looking for a pattern with a specific requirement. For example, the last High must be higher than the first High. Otherwise we would not be interested in it, regardless of the proximity. To specify such a pattern, we can select a region between the first and the last Highs. Assume that the last High is already larger than the first one; otherwise modify them. Then check on the Required comparison checkbox in the comparison pairs dialog as follows:

If you are anxious to start using patterns, you can skip to the chapter named Saving, Loading, Matching and Viewing.

Vector Quantization matching

Vector Quantization is a more sophisticated method of matching. It looks at the big picture instead concentrating on details. Let us see this on an example. Suppose we are trying to detect an upward trend using Order matching, as shown in the pattern below:

The picture below shows a nice trend upward, but it would not match the pattern above:

To see this let us signify the Close prices and try to use Order matching:

The connecting lines go down as often as they go up. The Order matching method will not recognize this as a upward trend. The proximity of the (match of the) two patterns will be 4, while the worst possible match, a perfect down trend, would have a proximity of 9.

Vector Quantization matching would do a much better job here:

Selecting and deselecting the relevant points for Vector Quantization method can be done by selecting a region and using Point relevance from the Pattern menu or by pushing this button on the toolbar:


Then select the points and check or uncheck the Set checkbox as appropriately:

This causes the change in the relevance of each selected point in each bar in the selected range.

In vector quantization, the patterns being matched are overlaid and the differences between the corresponding relevant points are squared and summed up. The square root of that gives the Proximity. This is only a naive look at Vector Quantization matching. Before this matching applies, some pre-processing of the patterns is done in order to allow stretching and moving of the patterns. The stretching, and vertical alignment options can be set from the Edit pattern matching options in the Pattern menu, or by pushing this button:

For each time series you can then select the matching options. First you need to select a time series by clicking on it:

Then you can push the setup button, or just double click on the desired item in the list box. The following dialog box comes up:

There are two groups of scaling options for pattern matching using Vector Quantization: Offset and Range. The offset tells how the two patterns are aligned before the matching is attempted. The range tells how the patterns are stretched (scaled) before the matching is attempted. The available options are:

Offset options:

Position matters. If in your pattern the vertical position is important then check this option. If the position does not matter, then the two patterns are brought together (slided vertically) until they overlap. Then they are matched. Typically for price patterns position does not matter. If you design the pattern when the price is around 350 points, for example, you want the pattern to work even when the price goes to 400 points. On the other hand, for indicators with fixed scaling like PercentR it is typically important whether the value is at 30% or at 70%. To be precise, if you check Position matters, both patterns are shifted relative to themselves, and if you uncheck Position matters - both are shifted relative to the first pattern.

Unchanged. The matching is attempted without any shifting. This is only suitable for data series with fixed scale. It makes the matching very inflexible.

Average. The matching is attempted after shifting the patterns relative to the average of other time series. The list box on the right of this option determines which time series contribute to the averaging. You can select any of them, but it is only wise to select ones that have a comparable range of values. Checking Open, High, Low and Close at the same time is a good idea, while checking Volume and Close does not make sense.

Last. Matching is attempted after shifting the patterns relative to the last value of the time series selected in the combo box next to this option. This option is used to scale moving averages and prices relatively to the last Close. Use this if you are designing a system that compares moving averages against prices or different moving averages against each other.

Range options:

Range matters. If the vertical size of the pattern (this part of the pattern) matters, you need to check this option. This could be different for different kinds of patterns, but if you are designing patterns that will be used in many markets, you definitely need to un-check this option. To be precise, if you check Range matters, both patterns are stretched relative to their own vertical size, and if you uncheck Range matters - both are shifted relative to the first pattern.

Unchanged. The matching is attempted without any stretching. This is only suitable for indicators with fixed scale. It makes the matching very inflexible.

Std. deviation. The patterns are stretched (or squeezed) to fit exactly the range defined by standard deviation of the time series selected in the combo box on the right of this option. Use this option if the patterns contain occasional peaks, but most of the time they stay within a certain range.

Min.-Max. The patterns are stretched (or squeezed) to fit exactly the range between the minimum and the maximum of the respective time series selected in the combo boxes on the right of this option. Use this option for time series that are scaled between the Low and the High prices.

You can select these options for each time series in the pattern. For your first attempt, you can leave these options alone; the default options define the usual situation.

Saving, Loading, Matching and Viewing

You can save patterns for future use. To do this, select Save from the Pattern menu, or push this button:

Then type the file name in which you want to save this pattern:

The usual extension for patterns is .ptn, but you may use any extension.

To load a previously saved pattern, you must first open a page that contains the same indicators. To do this, you must post the appropriate exporting indicator in TradeStation or SuperCharts. If you do no longer have this indicator, or you received the pattern file from somebody without the appropriate exporting indicator, Visual Pattern Designer Professional can generate this indicator automatically. You can find out how to do this in the next chapter. Once you have the appropriate page opened, select Load from the Pattern menu and select the file name in the dialog box that pops up:

The loaded pattern always places itself at the beginning of the chart (the earliest bar).

Finally, after a long wait, we can start matching patterns. There are two ways to do this:

In TradeStation or SuperCharts, by calling the external DLL function PatternMatch or PatternMatch2. This is not something that you should attempt yourself. Not because it is very difficult, but because Visual Pattern Designer Professional can write a program for this by itself. So, we will not even explain how to do this. If you are curious, you can use VPD to generate such a program, as explained in the next chapter, and then look at the program. Anyway, this process is used for backtesting or running systems designed using VPD, in real time.

Select Find matches from the Pattern menu or push this button:

The following dialog box will come up:

You can search for best matches or match the latest several bars and find out the proximities. You can also specify the desired number of patterns to be searched for. Note that if the specific requirements in the Order matching narrow down the choice of patterns too much, VPD may find smaller number of matches than the specified. Click on OK. This will only take a short time. On the dialog box that pops up you will see the percentage of progress:

You can cancel the search at any time by clicking on the Cancel button. After the searching is done, the matches found can be looked at using the menu selections: Find first match, Find previous match, Find next match or Find last match from the Pattern menu, or using the following buttons:


Each time you move between matches the current view shifts horizontally, in order to place the current match in the center of the window. The selected range shows the currently selected match, while the fourth and the fifth fields of the status bar show the rank of the match (0 = best match) and the proximity of the current match. This will give you a good idea of the value of the pattern you are designing. The most interesting thing to look at is what happens after the pattern. To remove the matches, use Remove found patterns from the Pattern menu, or push this button:

Let VPD write indicators and systems for us

The most valuable feature of Visual Pattern Designer Professional is its automatic program generation capability. It can write indicators that export data from TradeStation or SuperCharts to VPD, indicators that display how well a pattern matches the current market situation, and systems that use pattern matching. The programs generated are written in Easy Language but to achieve fast and powerful pattern matching they call external functions defined in our library (DLL) which are written in C++. This makes VPD systems relatively fast. Although you may wait 10-15 seconds when you start a system, this is still very fast. If the same pattern matching algorithms were written in Easy Language, they would be hundreds of times slower. Besides that, these programs would not fit in the maximal allowed program size in Easy Language. Although the automatically generated programs are so called Power Editor programs they can be run in both TradeStation and SuperCharts. There are four kinds of programs that VPD generates:

VPD generated Exporting indicators from users choice. The user is allowed to choose studies from the ones available in TradeStation or SuperCharts or add his/her own studies for exporting. The resulting indicator can be run in TradeStation or SuperCharts, to export the selected studies to VPD. When opening a page in VPD, the exported indicators are offered. To define an exporting indicator in this way, select Generate exporting indicator from users choice from the Program menu or push this button:


The following dialog box pops up, in it you can select from the available indicators and push Add >> and Remove << to change the list of exported studies (time series):

Note that the following time series are automatically exported and you do not need to export them: Open, High, Low, Close, Volume, Open Interest, Up Ticks, and Down Ticks. To define your own indicators type the name in the Name edit box and the definition in the Definition edit box. You can call user and built-in functions as well. After typing the name and the definition, push the Add >> button, to add your custom study to the list of exported time series. When you click on the OK button, a notepad should pop up with the generated program. Don't be scared of it. It runs in TradeStation and SuperCharts without any modifications. To find out how to export this and other indicators and systems see the box named Exporting the programs generated by VPD later in this chapter.

VPD generated Exporting indicators generated from patterns. If you have a pattern that you want to view or edit you need to have a compatible exporting indicator in order to open a VPD page in which you can load the pattern. You may have deleted the exporting indicator, forgotten its name, or received the pattern from somebody that did not give you the appropriate exporting indicator. No problem. Just select Generate exporting indicator from pattern from the Program menu or push this button:


Then select the pattern file name, and the compatible exporting indicator will be there. Transfer it to TradeStation or SuperCharts and post it. Then start a page in VPD by selecting the name of the pattern followed by a number (which represents a timestamp of when this indicator is generated - unimportant for the user). Then you can view and edit this pattern.

VPD generated Pattern Matching indicators. These indicators display how well a pattern matches the current market situation. To generate such an indicator, select the Generate indicator option from the Program menu or push this button:


Then select a pattern file name for the desired pattern.

VPD generated Systems. Now it's time to use the patterns that you designed to make some money. To generate a system, select Generate system from the Program menu in VPD, or push this button:


The following dialog box will come up:

The edit box on the top specifies the name of the chart. If you want to give it a name, type in the new name and push the Tab key. To define the conditions for buying, push on the Buy button, and for exiting long trades, use the Exit Long button. Similarly, for short trades, use the Sell and Exit Short buttons. The following window comes up, to allow you to specify each condition:

You can specify up to three patterns that can cause a signal for a specific trade. Later on you can add more patterns by copying and pasting into the automatically generated system that pops up in a Notepad window. To select a pattern, use the corresponding s button, and to remove the pattern use the X button. The signal will be generated if at least one of the patterns occurs with proximity less one than the number in the corresponding <= Proximity edit box. The proximity value is the trickiest part here. You have to remember what proximity you are expecting in a good match that triggers a signal. This can be found out in the Visual Pattern Designer window, while developing the pattern. For example, if you are looking for the 10 best matches of the pattern in the chart, after the search, take a look at the proximity of the 10th best match. If you put this value in your system in the <= Proximity edit box, you will get 10 signals from this pattern, when trading on the same chart. This is because only 10 patterns will have proximity better (smaller) than or equal to the 10th best match. Push OK when you are done, and OK again to generate the system. Notepad will pop up with the generated system. You can modify this system if you want to add your own spices to it. If you modify it, don't forget to save it at the end.

Transferring the programs generated by VPD:

For SuperCharts and TradeStation users: Just close the notepad and go to SuperCharts or TradeStation and select Transfer from the Editor or Quick Editor menu. Select the appropriate indicator or system and click OK. You may need to verify the transferred system or indicator in some versions of TradeStation. The names of the indicators and systems are as follows:

- VPDP Export (User) for the exporting indicators generated from users choice.

- VPDP Export (Pattern) for the exporting indicators generated from patterns.

- VPDP Pattern Match for the indicators for displaying the proximity of the pattern match against the current market situation.

- VPDP System for the systems based on selected patterns.

For TradeStation users only: Use the Select All option from the Edit menu in the Notepad window in which the generated program is placed. Then use Copy from the Edit menu to copy the contents to the Clipboard. Switch to the TradeStation Power Editor and create a new system or indicator as appropriate. Name it and then in the empty window paste the contents from the Clipboard by selecting Paste from the Edit menu in Power Editor. With this method you can pick any name for the indicators and systems generated by VPD.

Which matching method should you use?

Although this is an arguable issue, we can give some pointers:

If the pattern is very short, 3 bars for example, it is more likely to be suitable for Vector Quantization matching. This is because the expectations from the 3 bar pattern can be clearly defined in detail. We can see each comparison pair clearly. On the other hand, if the pattern is 50 bars long, then it is difficult to specify how each point should compare to the neighboring ones. In such cases we are most likely interested in the general shape of the pattern, and Vector Quantization does a better job in recognizing it.

A typical problem with Vector Quantization is an ignorance of comparison pair detail. For example, let us have a 2 bar pattern in which we expect the last High to be higher than the first High, and let us assume that this is very important. Vector Quantization matching will return a low proximity value even if the last High is close to being higher than the first high, which is not what we want.

A typical problem with order matching is that the comparison pair criteria are either satisfied or not, and there is no gray solution. For example, let us look at the closing price, which represents a trend:

Actual Expected


If we set comparison pairs in each consecutive two points of the Close, the Order matching will return a very high proximity value when comparing the above two patterns (marked Actual and Expected), because nearly every other sequence of two Closes goes down instead of up. Vector Quantization would cope with this situation properly.

Because the proximity is scaled differently for Order and Vector Quantization matching, Visual Pattern Designer Professional does not allow mixing of the two matching modes for the same pattern. If you really want to use the outcome of both matching methods, we suggest that you create two patterns, by saving the desired pattern under two different file names. Then load each one of them separately, and set Order Matching in one and Vector Quantization matching in the other. Then match both patterns against each bar in your system. It is not a problem to design a system with Visual Pattern Designer Professional that uses two patterns for one signal (buy, for example), of which one uses Order matching, while the second one uses Vector Quantization matching.

You can view statistical results on the matching, by selecting statistics in the outcome window using the right mouse button. For each bar in the outcome you will see the average close connecting line in red, the average high-low bars in red and the minimal low to maximal high bars in green. If you want to view the numerical values, select statistics (numeric) using the right mouse button and the following window will pop up:

If the outcome looks good, don't forget to save the pattern by pushing on the save button. The only part that bothered the first reviewer of this manual was the 'looks good' part. I can relate, it's the same as when my friend said to me 'That's a healthy horse, over there', but all horses look the same to me. I don't know anything about them. So let's elaborate on the 'looks good' part:

When you select the this pattern option using the right mouse button in the outcome window, you can view the outcome after each individual pattern separately. To move from pattern to pattern, use the outcome selection buttons. If, for example, all outcomes show steep bullish movement, hat is a 'buy' pattern. If the market forms that pattern - buy. If all outcomes dive down you have a 'sell' pattern in hand. In reality though, this will almost never happen. Some outcomes will go up, and some down. If as many go up as down, this pattern is not very useful. If most of them go up it's still a buy. It's also important how far up the market moves. If you are testing your pattern on charts with very little data, you can be easily mislead. Especially if you select a trendy market to test on. If for example, the market you are testing on is almost always bullish, then most of the patterns will result in bullish outcomes. Try the same patterns on a prevalently bearish market. You may be unpleasantly surprised.

If you want to see all patterns outcome at once you can select the statistics option with the right mouse button in the outcome window. The green curve that goes across from the left to the right will tell the direction of the market. This is the line that connects the average close values. If I had to dream up a perfect 'buy' pattern, I would have this green line go straight up from the middle on the left side to the top right corner of the outcome window. The red vertical bars would be very small, and the green vertical bars (also small) would surround them. The green bars connect the highest high and the lowest low prices, which means the best outcome and the worst outcome. The red bars connect the average high and the average low prices, which tells us what happens in average. Once you get used to this picture, you will look at the statistics first, and if you encounter unusually wide green bars, you would select the this pattern option to see whether only a few pattern outcomes deviate from the average, or they are scattered all over.

You can write your own pattern based system even with the Quick Editor. The easiest way to learn this is to look at the system VPD SC included in the Visual Pattern Designer diskette. You can view it using the TradeStation or SuperCharts Quick Editor:

and

the user function SetVPD is used to export the data to Visual Pattern Designer. It always returns 1. The user function VPD_P1 matches the last pattern (the market now) against the pattern saved in the file p1.ptn in your Visual Pattern Designer directory. The user function VPD_P2 matches the last pattern (the market now) against the pattern saved in the file p2.ptn in your Visual Pattern Designer directory. Both return the proximity of the match (the result). Again 0 means perfect match, and as this number gets higher, the match is worse.

To write your own system modify the patterns p1.ptn and p2.ptn and the proximity values (which are 10 and 100 in this example). To find out what are the most appropriate values here, remember the rough range of proximities obtained while testing your patterns. Then experiment around those values. If you put values that are too high, you will get a lot of trades with poor quality, and if you set them too low, you may not get enough trades. If you have TradeStation and you want to get sophisticated, you can use the Power Editor to write your own system.

For gurus only

If you a beginner you can safely skip this chapter. When you are ready to perform your own miracles with Visual Pattern Designer, take a look at this first.

If you want to use the TradeStation Power Editor there are only three DLL functions that you can call to use Visual Pattern Designer. You can call them just like user functions, except that you have to declare them before using them. The example indicator VPD Match test included in the Visual Pattern Designer diskette plots the proximity of the current market pattern to the pattern test.ptn.

Vars: Proximity(0);

DefineDllFunc:'VPDVPD_TS.DLL',DWORD,'InitVPD',

LPSTR,LONG;

DefineDllFunc:'VPDVPD_TS.DLL',WORD,'ExportVPD',

LPSTR,LPLONG,LPLONG,LPLONG,LPLONG,LPLONG,LPINT;

DefineDllFunc:'VPDVPD_TS.DLL',FLOAT,'PatternMatch',

LPSTR,LPSTR,INT;

IF CurrentBar = 1 THEN BEGIN

EnableVPD();

InitVPD('Match test',PriceScale);

END BEGIN

EnableVPD();

ExportVPD('Matchtest',&Open,&High,&Low,&Close,&Date,&Time;

END

IF CurrentBar > 30 THEN BEGIN

Proximity = PatternMatch('Match test','vpdtest.ptn',0);

Plot1(Proximity,'Proximity');

END;

The function InitVPD initializes the Visual Pattern Designer DLL vpd_ts.dll. It returns 0 upon failure, or non-0 otherwise. It takes two parameters: the chart name (you can make up any name yourself) and the price scale of the market (see the TradeStation or SuperCharts built in function PriceScale).

The function EnableVPD has to be called before each call of the functions InitVPD and ExportVPD. It checks the licensing information for your copy of Visual Pattern Designer and allows its usage if your license is valid. If this function is not called before InitVPD or ExportVPD is, Visual Pattern Designer can not communicate with TradeStation or SuperCharts.

The function ExportVPD is used to export data from TradeStation or SuperCharts to Visual Pattern Designer. The first parameter is the name of chart defined in the InitVPD call. You must copy the other parameters exactly as in the above example, otherwise unpredictable behavior can occur.

The function PatternMatch matches a specified pattern from the selected chart against a pattern saved in a file and returns the proximity value. The name of the selected chart is specified in the first parameter. This name is defined in InitVPD and used in ExportVPD. The second parameter specifies the name of the file which holds the template pattern. The third parameter specifies the last bar of the pattern in the selected chart. 0 means the current pattern, 1 - the pattern that occurred 1 bar ago, etc.

Note that only one indicator or system can use a chart. Name a different chart for each system or indicator. The charts are very frugal with space, and there is no need to save on number of charts defined. No data is actually exported to Visual Pattern Designer. Only pointers are passed to it.



Note that it is not possible to install the current version of Visual Pattern Designer Professional in a directory other than VPD. Also Visual Pattern Designer Professional must be installed on the same disk as TradeStation or SuperCharts. This is because the current version of Omegas Easy Language can not load DLL functions from locations specified by textual parameters. Thus allowing installation of Visual Pattern Designer Professional in an arbitrary directory could cause a problem with running the generated Easy Language scripts on another computer. We chose to impose this limitation rather than adding another directory to the DOS path which, on many DOS installations, is already at its size limit.



Politica de confidentialitate | Termeni si conditii de utilizare



DISTRIBUIE DOCUMENTUL

Comentarii


Vizualizari: 843
Importanta: rank

Comenteaza documentul:

Te rugam sa te autentifici sau sa iti faci cont pentru a putea comenta

Creaza cont nou

Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved