Close
Skip to content

Tutorial 17 | A simple strategy based on CCI zero bounce

Welcome to tutorial 17 in this series of tutorials that demonstrate and explain TradeStation EasyLanguage programming concepts. The idea behind the series is that if you learn the TradeStation EasyLanguage yourself, you will have a skill that will enable you to program and try out trading ideas.

As always, the purpose of this tutorial is to demonstrate the programming techniques rather than to create a tradeable indicator. I am using TradeStation version 8.1 to create this tutorial.

 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.

Before reading this tutorial, you might like to review tutorial 6. Tutorial 6 uses similar concepts, only, rather than generating a trade, it simply ‘prints’ a word on the chart. This tutorial takes the concept one step further and creates a simple strategy which looks for a zero bounce in the CCI indicator and generates a trade. The strategy uses TradeStation’s built-in profit target and stop loss functions.

Step 1

Create a new EasyLanguage strategy. Delete the default program and enter the following EasyLanguage code:

Tutorial 17 EasyLanguage code The comments (shown in green) explain each part of the program. In the buy statement I added the CCI( SlowLength ) > 0 to check that the CCi is still above zero before issuing an order.

Note that the program only creates ‘buy’ orders.

Step 2

Apply the strategy to a chart. In order to visualize what is happening, you might like to apply a CCI indicator. Make sure that the inputs for the indicator are the same as the ones you are using in the strategy.

Tutorial 17 applied to chart

Step 3

This strategy may have some potential, but it will require some work. For example, you might consider that for a zero-bounce to be really valid, it should be ‘V’ shaped (as opposed to ‘U’ shaped). The strategy does not test for this. You may also like to add sell short orders if the CCI bounces in the downward direction.

When you have created enhancements and if you think that the strategy has potential, you will likely want to do some optimization.

Be careful not to ‘curve-fit’ as you do this. It is possible to make a “no-hoper” strategy look good by over-optimizing.

I will look at optimization in the next tutorial in this series.

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.

If you see any errors in this tutorial – or I have not made something clear, I would be most grrateful if you could please let me know. You can e-mail me at: tutorials@markplex.com. Also, let me know if you have any ideas for new tutorials.