Tutorial 6 | Modified CCI indicator to add zero rejection notification to 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.

In tutorial 5, we looked at the standard Commodity Channel Indicator (CCI) provided by TradeStation and modified it to include fast and slow CCIs together with a zero line. We also added a histogram under the slow CCI. The result, when applied to a chart, looked something like the following:

Tutorial 6 image

This tutorial takes the CCI indicator and uses it to demonstrate how to ascertain when a pivot has occurred on the CCI plot and how to add text to a price chart. Specifically, we will look to find ‘pivots’ in the CCI that occur on, or near, the zero line.

Please note that any EasyLanguage trading strategies, indicators, showme studies, paintbar studies, probabilitymap studies, activitybar studies, functions (and parts thereof) and associated techniques included in or attached to this tutorial are examples only, and have been included solely for educational purposes. does not recommend that you use any such trading strategies, indicators, showme studies, paintbar studies, probabilitymap studies, activitybar studies, functions (or any parts thereof) or techniques. The use of any such trading strategies, 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.

Step 1

EasyLanguage has a built in Pivot function. The following code searches for pivots in the slow (colored cyan in my example) CCI line.

Tutorial 6 image

Modify the EasyLanguage study from Tutorial 5 by adding the inputs, variables and the following statement:

Condition1 = Pivot(CCI( SlowLength ),Length,LeftStrength,RightStrength,1,-1,oPivotCCI,oPivotBar) <>-1
AND (oPivotBar-RightStrength) = 0;

When you have entered these lines, click on the word ‘Pivot’ with your right mouse button. The built-in TradeStation help functions will explain the inputs and outputs for the Pivot function. In summary:

CCI( SlowLength ) is the line on which we are looking for a pivot

Length is how many bars back we are going to examine in looking for this pivot.

LeftStrength and RightStrength determine the ‘strength’ of the pivot.

‘1‘ indicates that we are looking for the most recent pivot.

‘-1’ indicates that we are looking for a bottom pivot (or valley).

oPivotCCI and oPivotBar are the outputs from this function. oPivotCCI tells us the value of the CCI at the pivot and oPivotBar tells us how many bars ago that the CCI pivot occurred

(oPivotBar-RightStrength) = 0 tells us that the pivot occurred exactly RightStrength bars ago.

Step 2

To complete the modifications add the following statement below the pivot line:

If Condition1 AND oPivotCCI > -30 AND oPivotCCI < 30 then
Begin
Value1 = TEXT_NEW(D[oPivotBar],T[oPivotBar],L[oPivotBar]*Adj,”zBounce”) ;
TEXT_SETCOLOR(Value1,Green) ;
TEXT_SETSTYLE(Value1,2,1) ;
End;

Your code should now appear as below:

Tutorial 6 image

The first part of the statement:

Condition1 AND oPivotCCI > -30 AND oPivotCCI < 30 is true when there is a pivot in the CCI AND at the pivot bar, the value of the CCI is between -30 and +30.

The second part of the statement ‘prints’ a statement on our chart when a zero ‘bounce’ has occurred. By inputting the program and right-clicking on a particular part of the syntax, you will get an explanation of what the function achieves. In brief:

Value1 = TEXT_NEW(D[oPivotBar],T[oPivotBar],L[oPivotBar]*Adj,”zBounce”) ;

Adds text to the chart.at the date (D[oPivotBar]) and time T[oPivotBar] of the pivot bar. The text is printed just below the low of the bar using the ‘*Adj* statement (L[oPivotBar]*Adj) and the text ‘zBounce‘ is printed. The reference ID for the text is assigned to Value1.

TEXT_SETCOLOR(Value1,Green) ;

This statement sets the color of the text whose reference ID is Value1.

TEXT_SETSTYLE(Value1,2,1) ;

This statement sets the style of the text whose reference ID is Value1

Step 3

When the indicator is completed, it should be verified and then applied to a chart. The result should look something like this:

Tutorial 6 image

Summary

This tutorial demonstrates the use of the pivot function applied to an indicator. It also demonstrates the use of the TEXT_NEW function to add text to a chart when certain conditions occur.

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.