Program 24 | CCI hidden or reverse divergence

In Program 11 I created  a Commodity Channel Index (CCI) indicator that looked for regular divergence between price and CCI. This new indicator looks for hidden or reverse divergence between price and the CCI rather than regular divergence.

The following downloadable pdf file illustrates the difference between hidden and regular divergence. I also explain this in the video below. Click on the image to download the pdf file.

Note that in the examples the chart patterns in the two left columns could be classed as both regular and hidden divergence. The same is true for the two columns on the right. This is because the amplitude of the patterns shown is the same in both examples. When you are looking for divergence make sure that you are looking at the price or CCI action where I have drawn the trend lines.

Program 24 has:

  • An input that allows users to look for hidden divergences between price and the smoothed fast CCI
  • A user input allows the user the option of drawing a line when there is a possible hidden divergence. The line disappears if the hidden divergence. were not confirmed when the bar closes.
  • An input that means the program looks for potential hidden divergences consisting of two CCI pivots, an initial price pivot and then a price occurring on the same bar as the second CCI pivot that indicates a possible divergence. The second price ‘sampling’ does not necessarily need to be a price pivot. The idea is that it could possibly give the user early warning of a divergence, prior to the price pivot occurring

I explain these new features in the video below.

This UNPROTECTED TradeStation EasyLanguage indicator and a PROTECTED smoothed CCI function are available for immediate download for $69.95. The indicator is commented throughout. Click on the ‘add to cart’ button to pay using a credit card or PayPal. The download includes a plain text version of the program (but not of the the protected CCI function).

The program was developed in TradeStation 9.0  and works on intraday, daily, weekly, and monthly charts.

You can also download a packaged bundle of programs 11 and 24 for a special discounted price of $119- (i.e. $20 off the regular price for both programs bought separately). Click on the ‘add to cart’ button to pay using a credit card or PayPal.

If you are a Gold Pass member make sure you enter the special coupon code to get 20% discount off these prices.

The following images show the Program 11 and Program 24 smoothed Markplex CCI indicator, compared with the CCI indicator supplied with TradeStation.


As with program 11, program 24 also looks for cases where the smoothed CCI pivot may match the second most recent price pivot OR the one before it (i.e the third most recent price pivot). ‘Secondary’ divergences, as I refer to them here, are drawn in magenta or cyan. ‘Primary’ divergences are drawn in red or green. I have included a comprehensive color guide below.

Program 24 applied to a 1 minute GBPUSD chart. A bearish hidden divergence is shown by the red line drawn on the chart. The price has made a lower (or equal) high and the smoothed CCI has made a higher high.

The program includes a feature enabling the user to modify a user input to look for divergences between price and the smoothed fast CCI. This is illustrated in the image below where hidden divergence between price and the smoothed CCI and price and the smoothed fast CCI, occur on the same bar. Notice the two lines, one red and the other dark red. The dark red line shows potential divergence between price and the smoothed, fast CCI.

Program 24 applied to a 1 minute GBPUSD chart. The chart shows a reverse or hidden divergence between price and the smoothed fast CCI. The darker lines represent divergence with the fast CCI.

The following image gives an example, of what I have described as ‘secondary’ divergence.’ Notice an intervening low price pivot in price between the two high price pivots. This is ignored and hence we show a ‘secondary’ divergence in magenta.

The magenta line illustrates what I have described as secondary divergence. We take the most recent price pivot and the third most recent price pivot and we compare them with the two most recent CCI pivots. I explain this in the video.

The following image shows a bullish hidden divergence.

An example of a bullish hidden divergence

A bullish secondary divergence.

Plots

Plot1 = Regular CCI
Plot2 = Smoothed CCI
Plot3 = Smoothed CCI (may be plotted as a histogram)
Plot4 = Smoothed Fast CCI
Plot5 = ‘OverBought’ horizontal line
Plot6 = ‘OverSold’ horizontal line
Plot7 = Zero horizontal line

in addition plots Plot 8 to Plot 23 plot 100 when divergences occur.

See a video demonstration below.

Bear in mind that this indicator is a tool and consequently you will likely need to adjust the various inputs to obtain potentially useful information. It is also worth noting that it is still important to carefully look at the chart to ensure that potential divergences really exist. You would also need to find confirming signals or indicators prior to trading.

This UNPROTECTED TradeStation EasyLanguage indicator and a PROTECTED smoothed CCI function are available for immediate download for $69.95. The indicator is commented throughout. Click on the ‘add to cart’ button to pay using a credit card or PayPal. The download includes a plain text version of the program (but not of the the protected CCI function).

The program was developed in TradeStation 9.0  and works on intraday, daily, weekly, and monthly charts. The indicator can also be applied to tick charts and the CCI plots work correctly, however, on a tick chart several bars can have the same time signature, this means that the divergence lines may not calculate or draw accurately. Provided you always double check possible divergences, the tool may still be useful on tick chart analysis.

You can also download a packaged bundle of programs 11 and 24 for a special discounted price of $119- (i.e. $20 off the regular price for both programs bought separately). Click on the ‘add to cart’ button to pay using a credit card or PayPal.

If you are a Gold Pass member make sure you enter the special coupon code to get 20% discount off these prices.

See the video below for more information.

User inputs

SmoothCCIFastDiv( TRUE ), // If TRUE also draws hidden divergences between price and SmoothCCIFast
EarlyWarning( TRUE ), // If FALSE waits until end of bar to draw divergence, otherwise it draws line if divergence condition in place during bar formation
OnePricePivDiv( FALSE ), // If TRUE looks for 2 pivots in CCI and only the first one in price
ShowLines1( TRUE ), // If TRUE draws lines to illustrate potential hidden divergences
ShowLines2( TRUE ), // If TRUE draws lines to illustrate potential hidden ‘secondary’ divergences
LineSeparator( MinMove / PriceScale ), // Determines vertically how far apart certain divergence. lines are drawn
LowerLine( -100 ), // Used to draw horizontal line at the user input level
UpperLine( 100 ), // Used to draw horizontal line at the user input level
LowerColor( Green ),
UpperColor( Magenta ),
CCIFastColor( Red ), // Color of fast smoothed CCI
SmoothCCIColor( Cyan ), // Color of smoothed CCI
CCIColor( DarkGray ), // If ‘legacy’ CCI drawn, specify its color
ShowRegularCCI( FALSE ), // If TRUE ‘legacy’ CCI drawn
HorizLines( DarkGray ), // Color of horizontal lines
CCILength( 14 ), // CCI length
FastLength( 6 ), // Length of ‘fast’ CCI
SmoothLength( 14 ), // Factor used to smooth CCI
FastSmoothLength( 14 ), // Factor used to smooth fast CCI
Length ( 20 ), // Lookback length when looking for pivots (used to find divergences)
LeftStrength( 3 ), // Left strength of pivots
RightStrength( 1 ), //Right strength of pivots
BarTol( 3 ), // The number of bars within which the price and CCI pivot must occur for the pivots to be considered to have occurred at the same time
PriceL( Low ), // Price used to find low pivots
PriceH( High ); // Price used to find high pivots

Divergence color Key

The colors below refer to the lines drawn on the price chart.

Low price pivots are based on the PriceL input. High price pivots are based on the PriceH input.

The key to ‘position’ in the table below is as follows:

O = Drawn between the high or low price pivots, depending on the type of divergence. For example, hidden divergence between two low price pivots and two low smoothed CCI pivots would be drawn between the two low price pivots.

A = Drawn above the high or low pivots by a user specified amount (LineSeparator), depending on the type of divergence. For example, hidden divergence between two high price pivots and two high smoothed CCI pivots would be drawn between the two low price pivots plus the amount specified in LineSeparator. If OnePricePivDiv is set to TRUE the line is drawn between the first pivot plus the amount specified in the LineSeparator input and the price on the bar where the second CCI pivot occurs plus the amount specified in the LineSeparator input.

B = Drawn below the high or low pivots by a user specified amount (LineSeparator), depending on the type of divergence. For example, divergence between two low price pivots and two low smoothed CCI pivots would be drawn between the two low price pivots less the amount specified in LineSeparator. If OnePricePivDiv is set to TRUE the line is drawn between the first pivot less the amount specified in the LineSeparator input and the price on the bar where the second CCI pivot occurs less the amount specified in the LineSeparator input.

DESCRIPTION COLOR POSITION
Price low pivot hidden divergence between two low price pivots and two low smoothed CCI pivots GREEN O
Price low pivot hidden divergence between two low price pivots and two low smoothed FAST CCI pivots DARK GREEN B
Price high pivot hidden divergence between two high price pivots and two high smoothed CCI pivots RED O
Price high pivot hidden divergence between two high price pivots and two high smoothed FAST CCI pivots DARK RED A
‘Secondary’ price low pivot hidden divergence between two low price pivots (the most recent and the second most recent) and two low smoothed CCI pivots CYAN O
‘Secondary’ price low pivot hidden divergence between two low price pivots (the most recent and the second most recent) and two low smoothed FAST CCI pivots DARK CYAN B
‘Secondary’ price high pivot hidden divergence between two high price pivots (the most recent and the second most recent) and two high smoothed CCI pivots MAGENTA O
‘Secondary’ price high pivot hidden divergence between two high price pivots (the most recent and the second most recent) and two high smoothed FAST CCI pivots DARK MAGENTA A
OnePricePivDiv set to TRUE. Price low pivot hidden divergence between two low smoothed CCI pivots, one low price pivot and the price that occurred at the most recent CCI pivot LIGHT GRAY B
OnePricePivDiv set to TRUE. Price low pivot divergence between two low smoothed FAST CCI pivots, one low price pivot and the price that occurred at the most recent FAST CCI pivot DARK GRAY B
OnePricePivDiv set to TRUE. Price high pivot divergence between two high smoothed CCI pivots, one high price pivot and the high price that occurred at the most recent CCI pivot LIGHT GRAY A
OnePricePivDiv set to TRUE. Price high pivot hidden divergence between two high smoothed FAST CCI pivots, one high price pivot and the high price that occurred at the most recentFAST CCI pivot DARK GRAY A
SECONDARY DIVERGENCE. OnePricePivDiv set to TRUE. Price low pivot hidden divergence between two low smoothed CCI pivots, one low price pivot (the second most recent) and the price that occurred at the most recent CCI pivot DARK BROWN B
SECONDARY DIVERGENCE. OnePricePivDiv set to TRUE. Price low pivot hidden divergence between two low smoothed FAST CCI pivots, one low price pivot (the second most recent) and the price that occurred at the most recent FAST CCI pivot DARK BROWN B
SECONDARY DIVERGENCE. OnePricePivDiv set to TRUE. Price high pivot hidden divergence between two high smoothed CCI pivots, one high price pivot (the second most recent) and the price that occurred at the most recent high CCI pivot DARK BROWN A
SECONDARY DIVERGENCE. OnePricePivDiv set to TRUE. Price high pivot hidden divergence between two high smoothed FAST CCI pivots, one high price pivot (the second most recent) and the price that occurred at the most recent high FAST CCI pivot DARK BROWN A

TO THE BEST OF MARKPLEX CORPORATION’S KNOWLEDGE, ALL OF THE INFORMATION ON THIS PAGE IS CORRECT, AND IT IS PROVIDED IN THE HOPE THAT IT WILL BE USEFUL. HOWEVER, MARKPLEX CORPORATION ASSUMES NO LIABILITY FOR ANY DAMAGES, DIRECT OR OTHERWISE, RESULTING FROM THE USE OF THIS INFORMATION AND/OR PROGRAM(S) DESCRIBED, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS. USE OF THIS INFORMATION AND/OR PROGRAMS DESCRIBED IS AT YOUR OWN RISK.

ANY EASYLANGUAGE OR POWERLANGUAGE TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (AND PARTS THEREOF) AND ASSOCIATED TECHNIQUES REFERRED TO, INCLUDED IN OR ATTACHED TO THIS TUTORIAL OR PROGRAM DESCRIPTION ARE EXAMPLES ONLY, AND HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES. MARKPLEX CORPORATION. DOES NOT RECOMMEND THAT YOU USE ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (OR ANY PARTS THEREOF) OR TECHNIQUES. THE USE OF ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS AND TECHNIQUES DOES NOT GUARANTEE THAT YOU WILL MAKE PROFITS, INCREASE PROFITS, OR MINIMIZE LOSSES.

This UNPROTECTED TradeStation EasyLanguage indicator and a PROTECTED smoothed CCI function are available for immediate download for $69.95. The indicator is commented throughout. Click on the ‘add to cart’ button to pay using a credit card or PayPal. The download includes a plain text version of the program (but not of the the protected CCI function).

The program was developed in TradeStation 9.0 and works on intraday, daily, weekly, and monthly charts.

The included function is ‘protected,’ in other words, you will not be able to see and edit the source code, but you will be able to apply it to a chart and modify the inputs.

You can also download a packaged bundle of programs 11 and 24 for a special discounted price of $119- (i.e. $20 off the regular price for both programs bought separately). Click on the ‘add to cart’ button to pay using a credit card or PayPal.


Video demonstration of Program 24

Using Program 24 with the TradeStation Scanner

Please email any bugs that you may discover to support@markplex.com.

Program 24 used with the TradeStation Scanner and linked chart

TO THE BEST OF MARKPLEX CORPORATION’S KNOWLEDGE, ALL OF THE INFORMATION ON THIS PAGE IS CORRECT, AND IT IS PROVIDED IN THE HOPE THAT IT WILL BE USEFUL. HOWEVER, MARKPLEX CORPORATION ASSUMES NO LIABILITY FOR ANY DAMAGES, DIRECT OR OTHERWISE, RESULTING FROM THE USE OF THIS INFORMATION AND/OR PROGRAM(S) DESCRIBED, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS. USE OF THIS INFORMATION AND/OR PROGRAMS DESCRIBED IS AT YOUR OWN RISK.

ANY EASYLANGUAGE OR POWERLANGUAGE TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (AND PARTS THEREOF) AND ASSOCIATED TECHNIQUES REFERRED TO, INCLUDED IN OR ATTACHED TO THIS TUTORIAL OR PROGRAM DESCRIPTION ARE EXAMPLES ONLY, AND HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES. MARKPLEX CORPORATION. DOES NOT RECOMMEND THAT YOU USE ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (OR ANY PARTS THEREOF) OR TECHNIQUES. THE USE OF ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS AND TECHNIQUES DOES NOT GUARANTEE THAT YOU WILL MAKE PROFITS, INCREASE PROFITS, OR MINIMIZE LOSSES.

Disclaimer The information, materials, products and services on this Web site are made available subject to the following terms and conditions. Markplex Corporation reserves the right to change these terms and conditions at its sole discretion. This Web site and any downloads, videos, tutorials, programs and information contained herein is presented solely for educational, informational, and/or entertainment use and under no circumstances should be used for actual trading. We at Markplex Corporation are not Broker/Dealers, Financial Advisers or Registered Analysts. No offer or solicitation to buy or sell securities, securities derivatives, futures products or off-exchange foreign currency (forex) transactions of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given or in any manner endorsed by Markplex Corporation. You are fully responsible for any investment or trading decisions you make. Futures and options trading has a large potential risk. You must be aware of the risks and be willing to accept them in order to invest in the futures and options markets. This Web site is neither a solicitation nor an offer to buy and/or sell futures or options. No representation is being made that any account will or is likely to achieve profits or losses similar to those discussed on this Web site. Past performance, whether actual or indicated by historical tests of strategies, is no guarantee of future performance or success. No warranties of profitability are being made or given. There is a possibility that you may sustain a loss equal to or greater than your entire investment regardless of which asset class you trade (equities, options futures or forex); therefore, you should not invest or risk money that you cannot afford to lose. CFTC RULE 4.41 - Hypothetical or simulated performance results have certain inherent limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not actually been executed, the results may have under- or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. Screen shots on this site are examples and are not meant to imply that any of the programs or tutorials available on this Web site will generate profitable trades. EasyLanguage or PowerLanguage trading strategies, signals, studies, indicators, showme studies, paintbar studies, probabilitymap studies, activitybar studies, functions (and parts thereof) and associated techniques referred to, included in or attached to this tutorial or program description are examples only, and have been included solely for educational, informational, and entertainment use. Markplex Corporation does not recommend that you use any such trading strategies, signals, studies, indicators, showme studies, paintbar studies, probabilitymap studies, activitybar studies, functions (or any parts thereof) or techniques. The use of any such trading strategies, signals, studies, indicators, showme studies, paintbar studies, probabilitymap studies, activitybar studies, functions and techniques does not guarantee that you will make profits, increase profits, or minimize losses. Markplex Corporation assumes no liability for any damages, direct or otherwise, resulting from the use of this information and/or program(s) described, and no warranty is made regarding its accuracy or completeness. Use of this Web site including the information, tutorials and/or programs included on it is at your own risk. You shall indemnify and hold Markplex Corporation harmless from any and all liability, loss, trading losses, costs, damage, or expense, including attorneys' fees you or third party may suffer (other than damage to your tangible property or injuries to employees occurring during the course of work) as a result of claims, demands, costs, or judgments arising out of third party and any other claims based on Markplex Corporation's performance, including, but not limited to losses resulting from the use of Markplex Corporation developed software, programs, web sites, tutorials, or the TradeStation charting and/or trading platform. Any testimonials on this Web site may not be representative of the experience of other clients and are not indicative of future results or success.
This Web site contains or may contain references and links to other companies and/or their Web sites, none of which is under the control of Markplex Corporation. Markplex Corporation makes no representations, warranties or endorsements whatsoever about any other Web sites to which you may have access through the Markplex Corporation Web site, or any products or services of those other companies, even if the products or services of those other companies or their Web sites are described or offered on the Markplex Corporation Web site or integrated with Markplex Corporation's products or services. TradeStation®, EasyLanguage® and PowerEditor® are registered trademarks of TradeStation Technologies, Inc. Other brand and product names which appear on this site are the trademarks or service marks of their respective owners, including: Microsoft® is a registered trademark in the United States Microsoft®Excel® is a registered trademark of Microsoft® Neither TradeStation Technologies nor any of its affiliates has reviewed, certified, endorsed, approved, disapproved or recommended, and neither does or will review, certify, endorse, approve, disapprove or recommend, any product or service that offers training, education or consulting regarding the use of EasyLanguage.

By continuing to use and navigate our sites, services, applications, tools or messaging, you are agreeing to our Terms and Conditions and the use of cookies, web beacons and similar technologies as described in our Privacy Policy and Privacy Policy on the use of cookies.