Skip to content

Tutorial 62 – Finding extreme values (e.g. find highest high in the last 5 bars)

Welcome to tutorial 62 in this series of tutorials designed to help you learn TradeStation EasyLanguage.

tutorial62-1This is a BEGINNER level tutorial that attempts to explain how to go about finding an extreme value going back a specified number of bars. I also demonstrate how to calculate the number of bars ago that the extreme occurs and what the value of another calculation is at this bar. Specifically we look for the highest bar in the last five (not including the current bar) and then we calculate what the CCI was for the bar where the highest high occurred.

An in depth video below, explains the tutorial in detail.

The program used in the tutorial video is as follows:

Var: H5( 0 ),
CCIVal( 0 ),
oExtremeVal( 0 ),
oExtremeBar( 0 ) ;CCIVal = CCI( 14 );
Plot1( CCIVal );H5 = Highest( H, 5 )[1];
Value5 = Extremes( H, 5, 1, oExtremeVal, oExtremeBar )[1];Value1 = Text_New( D, T, L, NumToStr( H5, 2 ) );

Print(D, T, ” H of last 5 bars starting 1 bar ago “,H5,” oExtremeVal “,oExtremeVal,” oExtremeBar “,oExtremeBar,” CCIVal “, CCIVal[ oExtremeBar ] );

Please join our email mailing list if you have not already done so and we will let you know when we release new tutorials or programs.

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.

Tutorial 62 Video – Finding the Highest High of the Last Five Bars


If you see any errors in this tutorial – or we have not made something clear, we would be most grateful if you could please let us know. E-mail us at: tutorials@markplex.com. Also, let us know if you have any ideas for new tutorials.

EasyLanguage is a programming language that is part of the TradeStation trading platform. It can be used to write programs to help in the technical analysis and trading of foreign exchange (forex or FX), commodities (e.g. the Dow e-mini, S&P e-mini etc), options, and stocks.