/*********************************************************************************************** Title: ROC Standard/Hidden Divergence Indicator for eSignal By: Divergence Software, Inc. Web: http://www.sr-analyst.com ================================================================================================ Project Description: This indicator will plot a standard ROC, and will also identify and plot standard (regular) divergences between the indicator and the price action OR it can be set to identify and plot hidden (reverse) divergences between the indicator and the price action. The indicator can also plot "potential" divergence. This is a situation where a divergence is likely but has not yet been confirmed, and can serve as a heads-up for a possible divergence situation. Script Parameters: Pivot Strength: Divergences are calculated by comparing recent high and low pivots in the indicator data to the same points in time in the price data. The Pivot Strength setting governs the definition of a pivot. A Pivot Strength setting of 1 (the default value) means that a pivot high is any high that has a lower high on either side. A setting of 2 would mean that a pivot high would be any high that has at least 2 lower highs on either side. The default setting of 1 should be the best setting to use in all situations but this parameter is provided so that you can change it if you need to. The range is from 1 to 20. Pivot Lookback: Whenever a new pivot in the data is identified, the indicator looks back over several pivots in an attempt to identify the longest divergence possible. This setting governs how far back the indicator will look. The default value is 5 which means that the indicator will analyze the price and indicator data between the current pivot and the 5th pivot back in time and will highlight the longest divergence it can find. You can set this to any value between 1 and 50. Divergence Type: Select between "Regular Divergence" and "Hidden Divergence". "Regular" divergence will look for situations where the indicator is seeing lower-highs while the price action is seeing higher highs or situations where the indicator is seeing higher-lows while the price action is seeing lower-lows. Conversely, "Hidden" divergence will look for situations where the indicator is seeing higher-highs while the price data is seeing lower-highs or situations where the indicator is seeing lower-lows but the price action is seeing higher-lows. Plot Potential Divergences?: True or False. Set this option to true and the indicator will plot both potential and confirmed divergences. Set this option to false and the indicator will only plot confirmed divergences. ROC Period: The input length for the ROC indicator. The default is 10. Price Source: The input price source to use for the ROC calculation. The default is "close". Upper Reference Band: The level at which to plot the upper reference band. The default is 0. Lower Reference Band: The level at which to plot the lower reference band. The default is 0. Plot Type: The plot-type to use for the indicator. You can select from Line, Histogram and Dot. The default plot type is Line. Plot Color: The color to use when plotting the indicator line. Default is blue. Thickness: The line thickness to use when plotting the indicator. Default is 2. Line Type: The line-type to use when plotting the indicator. Default is "Solid". Reference Band Color: The color to use for plotting the upper and lower reference bands. The default is black. Thickness: The line thickness to use when plotting the upper and lower reference bands. The default value is 1. Line Type: The line-type to use when plotting the reference bands. Default is "Solid". Confirmed Hi Div Color: The color to use when plotting a confirmed upper divergence line. Default is red. Thickness: The line thickness to use when plotting a confirmed upper divergence line. Default is 2. Line Type: The line-type to use when plotting a confirmed upper divergence line. You can select from Solid, Dash, Dot, DashDot and DashDotDot. The default is "Solid". Potential Hi Div Color: The color to use when plotting a potential upper divergence line. The default is maroon. Thickness: The line thickness to use when plotting a potential upper divergence line. Default is 2. Line Type: The line-type to use when plotting a potential upper divergence line. You can select from Solid, Dash, Dot, DashDot and DashDotDot. The default is "Dot". Confirmed Lo Div Color: The color to use when plotting a confirmed lower divergence line. Default is green. Thickness: The line thickness to use when plotting a confirmed lower divergence line. Default is 2. Line Type: The line-type to use when plotting a confirmed lower divergence line. You can select from Solid, Dash, Dot, DashDot and DashDotDot. The default is "Solid". Potential Lo Div Color: The color to use when plotting a potential lower divergence line. The default is darkgreen. Thickness: The line thickness to use when plotting a potential lower divergence line. Default is 2. Line Type: The line-type to use when plotting a potential lower divergence line. You can select from Solid, Dash, Dot, DashDot and DashDotDot. The default is "Dot". Use Sound Alerts?: True or False. Set this option to true to generate a sound alert whenever a upper or lower divergence line is first drawn and/or updated. Use Popup Alerts?: True or False. Set this option to true to generate a popup alert whenever a upper or lower divergence line is first drawn and/or updated. Use Email Alerts?: True or False. Set this option to true to generate an email alert whenever a upper or lower divergence line is first drawn and/or updated. Note that you must first configure your email settings using the eSignal Alerts Edit/Status Dialog off of the eSignal "View" menu in eSignal 10.x (or in the Application Properties section in eSignal 12.x). Lower Divergence WAV File: Use this option to set the WAV file that will play when a Sound Alert is triggered for a Lower Divergence. Default WAV file is BULLET.WAV. Any sound file that exists in your eSignal Sound Files Root directory can be entered here. Remember to use the ".WAV" extension. Upper Divergence WAV File: Use this option to set the WAV file that will play when a Sound Alert is triggered for a Upper Divergence. Default WAV file is DING.WAV. Any sound file that exists in your eSignal Sound Files Root directory can be entered here. Remember to use the ".WAV" extension. Disclaimer: For educational purposes only! Obviously, no guarantees whatsoever and use at your own risk. *******************************************************************************************************/