/******************************************************************** Title: Three Drive Pattern Script for eSignal 10.x By: Chris D. Kryza (Divergence Software, Inc.) Email: ckryza@verizon.net; ckryza@sr-analyst.com ===================================================================== Project Description: This script will identify and label bearish and bullish Three-Drive patterns. The script can be configured to search for these patterns over a range of pivot-strength settings which makes it very flexible. (See the Pivot Strength Explanation section at the end of this document). When loaded, the script will highlight all Three-Drive patterns that have occured in the historical data. As new bars come in, the script will identify new patterns as they form. Additionally, sound and pop-up alerts can be activated so that you will be alerted immediately as new patterns are found. Parameters: Pivot Strength Start: This is the 'starting' pivot strength setting that you want the script to use when searching for patterns. Valid range is from 2 to 40. Pivot Strength End: This is the 'ending' pivot strength setting that you want the script to use when searching for patterns. Valid range is from 2 to 40. Auto-Extend: This parameter controls how a pattern will be displayed on the chart. If Auto-Extend is set to (True), which is the default, the "E" leg of a pattern will be extended as each new bar completes as long as the pattern is still valid. When Auto-Extend is set to (False), the pattern will be considered complete on the first bar that all pattern criteria have been met. Show Bullish: This parameter allows you to filter the display of patterns. When set to (True), all bullish patterns will be displayed. When set to (False), all bullish patterns will be ignored. Show Bearish: This parameter allows you to filter the display of patterns. When set to (True), all bearish patterns will be displayed. When set to (False), all bearish patterns will be ignored. AB-XA Min: Enter the minimum percentage that the AB leg of the pattern should retrace/project the XA leg. Enter the percentage as a decimal value (e.g. 10% would be entered as 0.10, 127% would be entered as 1.27) AB-XA Max: Enter the maximum percentage that the AB leg of the pattern should retrace/project the XA leg. Enter the percentage as a decimal value (e.g. 10% would be entered as 0.10, 127% would be entered as 1.27) BC-AB Size Min: Enter the minimum ratio of the BC leg length to the AB leg length. The default is 1.272. Enter the ratio as a decimal value (e.g., 1.0 or 0.75, etc.) BC-AB Size Max: Enter the maximum ratio of the BC leg length to the AB leg length. The default is 1.618. Enter the ratio as a decimal value (e.g., 1.0 or 0.75, etc.) CD-BC Size Min: Enter the minimum ratio of the CD leg length to the BC leg length. The default is 0.618. Enter the ratio as a decimal value (e.g., 1.0 or 0.75, etc.) CD-BC Size Max: Enter the maximum ratio of the CD leg length to the BC leg length. The default is 0.786. Enter the ratio as a decimal value (e.g., 1.0 or 0.75, etc.) DE-CD Size Min: Enter the minimum ratio of the DE leg length to the CD leg length. The default is 1.272. Enter the ratio as a decimal value (e.g., 1.0 or 0.75, etc.) DE-CD Size Max: Enter the maximum ratio of the DE leg length to the CD leg length. The default is 1.618. Enter the ratio as a decimal value (e.g., 1.0 or 0.75, etc.) Fudge Factor: This parameter is used to specify the amount of leeway, in the form of a percentage, that you wish to apply to all of the retracement values. The default is 0.10 (10%). Enter the percentage as a decimal value (e.g. 10% would be entered as 0.10, 127% would be entered as 1.27) Pattern Color: This is the color that will be used to draw the primary pattern (e.g., the Three-Drive shape). Default is Dark green. Outline Color: This is the color that will be used to draw the retracement connector lines. The default is Purple. Label Color: This is the color that will be used to draw the leg labels (e.g., the X, A, B and C identifiers). Default is Red. Legend Color: This is the color that will be used to draw the retracement values over the outline lines. The default is Black. Pattern Thickness: This is the default thickness to use when drawing the primary pattern. The default value is 2. Outline Thickness: This is the default thickness to use when drawing the retracement connector lines. The default value is 1. Text Font Size: Font size to use for displaying the text in the indicator. Default is 11. Select a value between 8 and 55. Use Sound Alerts: Set to (True) if you want a sound alert to be triggered when a new pattern is found in realtime. Otherwise, set to (False). Default value is (False). Use Popup Alerts: Set to (True) if you want a popup alert to be triggered when a new pattern is found in realtime. Otherwise, set to (False). Default value is (False). Use Email Alerts: Set to (True) if you want an email alert to be triggered when a new pattern is found in realtime. Otherwise, set to (False). Default value is (False). Alert WAV File: Type in the name of the sound file (WAV File) that should be used for sound alerts. The default is BULLET.WAV. Display Menu Button: Set to (True) if you want the menu button displayed at the bottom-left of the chart (provides quick access to the indicator menu). Otherwise, set to (False). Default value is (True). Menu Button Font Size: Font size to use for displaying the menu button. Default is 10. Select a value between 8 and 55. Menu Button FG Color: Foreground color to use for the menu button display. Menu Button BG Color: Background color to use for the menu button display. Vert Offset: Vertical location, in pixels, of the menu button on the chart. Horz Offset: Horizontal location, in pixels, of the menu button on the chart. Pivot Strength Explanation The end-points of a three-drive-type pattern are based on swing-pivot points that occur in your price data. For a bullish three-drive pattern, the "X" point will be a swing-pivot high, the "A" point will be a swing-pivot low and so on. The real issue when trying to find three-drive-type patterns is deciding upon the criteria to use to define a swing-pivot high and a swing-pivot low. This script uses the concept of "Pivot Strength" to define swing-pivot highs and lows. For example, if a Pivot-Strength of 2 is selected then a swing-pivot high would be any high that has 2 lower highs on either side of it. The reverse would be true for a swing-pivot low. To extend the logic further, a Pivot-Strength of 3 would require that a high has 3 lower highs on either side of it and, again, the reverse would hold true for swing-pivot lows. Generally, the smaller the Pivot-Strength setting, the more swing-pivots you will find in your data, but they will tend to be small swings. A large Pivot-Strength setting (e.g., a requirement of 8 or 9 bars on either side of a high or low) will result in fewer swing-pivots but these price swings will tend to be much larger. This script allows you to specify a range of Pivot-Strength settings and, when activated, the script will monitor the formation of patterns for all of the Pivot-Strength values in that range. So, for example, if you set the Pivot Strength Start parameter to 3 and the Pivot Strength End parameter to 10, the script will, internally, create and store all swing-pivots found with a Pivot Strength setting of 3, all swing-pivots found with a Pivot-Strength setting of 4, and so on all the way up to a Pivot-Strength setting of 10. As each new bar comes it, it will scan for valid patterns at each one of these Pivot-Strength levels and will draw them on the screen if found. Please note that the larger the range you specify, the longer it will take for the script to load and the longer it will take for the script to advance as each new bar comes in. It is probably a good idea to restrict your range to 10 elements or less (e.g., a range of 3 to 13 should be just fine but a range of 3 to 30 is pushing it.) Dislaimer: For educational purposes only! Obviously, no guarantees whatsoever and use at your own risk. **********************************************************************/