Consolidation describes a period in time when a stock or security is not in or reversing a larger price trend. During consolidation the instrument typically trades within a limited price range. Tutorial 177 attempts to recognize periods of consolidation by calculating:
- The standard deviation of price.
- The ‘Consolidation Index’ by taking the average of true high over a number of bars, subtracting the average of the true low and dividing the result by the Average True Range.
The tutorial program then looks for when these values go below a user input percentile.
When a period of possible consolidation is found, tutorial 177 draws a box around it with the high of the box being the highest close of the price in the box and the low being the lowest low close of price in the box. The fill color of the box is determined by which way the consolidation was found and a user input (see SDevBox_Color and ConsolBox_Color).
Because periods of consolidation are sometimes associated with low volume the tutorial also changes the color
of the boxes when volume is below the average volume. The colors are also determined by user inputs (see
LVolSDevBox_Color and LVolConsolBox_Color.
In order to make it easier to see what user input color represents what a ‘key’ of the colors in drawn on the
chart in a fixed position.
Technical lessons
This tutorial illustrates various programming techniques, including:
- Drawing rectangle and text drawing objects using BNPoints and XYPoints to specify their size and/or position
- Creating methods to draw rectangles and calling the methods
- Extending rectangles as new price bars form
- Modifying drawing object colors and transparency
- Using intrabarpersist booleans to detect when a percentile has been crossed
Video walk through of tutorial 177
Download the tutorial 177 TradeStation EasyLanguage indicator
If you want to save yourself some typing, the tutorial 177 code is available for immediate download for $29.95 by clicking the following button. You can pay using PayPal or credit card. The program works with TradeStation 9.5 and 10.
The download consists of _Tutorial177 (the TradeStation EasyLanguage indicator developed in the tutorial).
See tutorial 43 if you need help on how to import an ELD into TradeStation.
Available colors to use as user inputs to tutorial 177
AliceBlue | DarkSlateGray | LightSalmon | PaleVioletRed |
AntiqueWhite | DarkTurquoise | LightSeaGreen | PapayaWhip |
Aqua | DarkViolet | LightSkyBlue | PeachPuff |
Aquamarine | DeepPink | LightSlateGray | Peru |
Azure | DeepSkyBlue | LightSteelBlue | Pink |
Beige | DimGray | LightYellow | Plum |
Bisque | DodgerBlue | Lime | PowderBlue |
Black | Firebrick | LimeGreen | Purple |
BlanchedAlmond | FloralWhite | Linen | Red |
Blue | ForestGreen | Magenta | RosyBrown |
BlueViolet | Fuschia | Maroon | RoyalBlue |
Brown | Gainsboro | MediumAquamarine | SaddleBrown |
Burlywood | GhostWhite | MediumBlue | Salmon |
CadetBlue | Gold | MediumOrchid | SandyBrown |
Chartreuse | Goldenrod | MediumPurple | SeaGreen |
Chocolate | Gray | MediumSeaGreen | Seashell |
Coral | Green | MediumSlateBlue | Sienna |
CornflowerBlue | GreenYellow | MediumSpringGreen | Silver |
Cornsilk | Honeydew | MediumTurquoise | SkyBlue |
Cyan | HotPink | MediumVioletRed | SlateBlue |
DarkBlue | IndianRed | MidnightBlue | SlateGray |
DarkBrown | Indigo | MintCream | Snow |
DarkCyan | Ivory | MistyRose | SpringGreen |
DarkGoldenrod | Khaki | Moccasin | SteelBlue |
DarkGray | Lavender | NavajoWhite | Tan |
DarkGreen | LavenderBlush | Navy | Teal |
DarkKhaki | LawnGreen | OldLace | Thistle |
Dark Magenta | LemonChiffon | Olive | Tomato |
DarkOliveGreen | LightBlue | OliveDrab | Turquoise |
DarkOrange | LightCoral | Orange | Violet |
DarkOrchid | LightCyan | OrangeRed | Wheat |
DarkRed | LightGoldenrodYellow | Orchid | White |
DarkSalmon | LightGray | PaleGoldenrod | WhiteSmoke |
DarkSeaGreen | LightGreen | PaleGreen | Yellow |
DarkSlateBlue | LightPink | PaleTurquoise | YellowGreen |
THE TRADING APPS, INDICATORS, SHOW ME STUDIES, STRATEGIES AND OTHER PROGRAMS HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES.
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, TRADING APPS, 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.