/*********************************************************************************************** Title: Trendlines Automatic Indicator for eSignal By: Divergence Software, Inc. Web: http://www.sr-analyst.com ================================================================================================ Project Description: This script replicates the behavior of the Tradestation Automatic Trendlines indicator but provides additional functionality (e.g., alerts, trendline logic customization, etc.) to create a more useful and effective trendline tool. It can be used with any type of bar or candle chart on any bar interval from Tick to Monthly. Script Parameters: Upper TL Pivot Strength: Number of bars to use to calculate the upper trendline pivot strength. An upper pivot is identified when that bar's high is higher than the preceding X bars (where X is the value you input in this field) and at least as high as the highest-high of the X bars that follow. The default value is 4. Range is from 1 to 9999. The current value will always be displayed in the study title. Lower TL Pivot Strength: Number of bars to use to calculate the lower trendline pivot strength. A lower pivot is identified when that bar's low is lower than the preceding X bars (where X is the value you input in this field) and at least as low as the lowest-low of the X bars that follow. The default value is 4. Range is from 1 to 9999. The current value will always be displayed in the study title. TL Extend Forward: Number of bars (past the most current price bar) to extend the two most current trendlines into the future. The default value is 15 (bars). Range is from 0 to 9999. Upper TL Color: The color to use when drawing upper trendlines. The default value is blue. Upper TL Thickness: The line thickness to use when drawing upper trendlines. The default value is 2. Range is from 1 to 10. Upper TL Style: Line type to use when drawing upper trendlines. Select from Solid, Dot, Dash, DashDot and DashDotDot. Default value is Solid. Lower TL Color: The color to use when drawing lower trendlines. The default value is maroon. Lower TL Thickness: The line thickness to use when drawing lower trendlines. The default value is 2. Range is from 1 to 10. Lower TL Style: Line type to use when drawing lower trendlines. Select from Solid, Dot, Dash, DashDot and DashDotDot. Default value is Solid. TL Length Logic (TLL): Select from "Draw First Found" and "Draw Longest Possible". When "Draw First Found" is selected (the default), the script will only attempt to draw a trendline back to the most recent older pivot that would create a valid trendline. This replicates the Tradestation trendline behavior. When "Draw Longest Possible" is selected, the script will search back through up to 11 older pivots and will draw the longest valid trendline that it can. The current value will always be displayed in the study title. TL Break Logic (TLB): Select from "No Restriction", "Unbroken by Close" and "Unbroken by High/Low". When "No Retriction" is selected (the default) the script will draw a trendline even if the trendline has been breached between the starting pivot and the ending pivot. This replicates the Tradestation trendline behavior. If "Unbroken by Close" is selected, the script will draw a trendline as long as price did not close beyond the trendline between the starting pivot and the ending pivot. If "Unbroken by High/Low" is selected, the script will draw a trendline only if price (high for upper trendlines and low for lower trendlines) did not breach the trendline between the starting pivot and the ending pivot. The current value will always be displayed in the study title. Show History?: Select from "T" (True) and "F" (False). When "T", is selected, all trendlines found, from the start of data to the end of data, will be displayed on the chart. When "F" (the default), only the most current upper trendline and the most current lower trendline will be displayed on the chart. Pivot Display: Select from "None", "All Pivots", and "Current TL Only". When "None" is selected (the default) no pivots will be highlighted. When "All Pivots" is selected, all of the pivots identified by the script will be highlighted with a colored dot. When "Current TL Only" is selected, only those pivots that comprise the most current upper and lower trendline will be highlighted with a colored dot. Upper Pivot Color: Color to use when highlighting upper pivots. The default color is red. Only applies when "Pivot Display" is set to something other than "None". Lower Pivot Color: Color to use when highlighting lower pivots. The default color is green. Only applies when "Pivot Display" is set to something other than "None". Alert On Close Only?: Select from "T" (True) and "F" (False). When "T", a price bar must close beyond a trendline for an alert to be generated. When "F" (the default), when any portion of a price bar breaches a trendline, an alert is generated. Alert Use Sound?: Select from "T" (True) and "F" (False). When "T", a sound alert will be generated whenever a trendline is breached. When "F" (the default), no sound alerts will be generated. Alert Use Popup?: Select from "T" (True) and "F" (False). When "T", a popup alert will be generated whenever a trendline is breached. When "F" (the default), no popup alerts will be generated. Alert Use Email?: Select from "T" (True) and "F" (False). When "T", an email alert will be generated whenever a trendline is breached. When "F" (the default), no email alerts will be generated. Alert WAV File: The WAV file to use for sound alerts. You can use any file present in your eSignal Sound Files Root. Disclaimer: For educational purposes only! Obviously, no guarantees whatsoever and use at your own risk. *******************************************************************************************************/