Pages

28 January 2013

Guestpost by Lar: KC_PercentK

TrendXplorer has been so generous in sharing his scripts, I thought I would share something in return I have been working on with him recently. It is a trend indicator based upon the Keltner Channel, with a Bollinger PercentB like concept, I have named KC_PercentK. However, it uses a short term (6,0.5) and a long term (20,1.5) PercentK to determine the trend.


It is a lower indicator with Price Bar Coloring options are as follows:
- Bright_Green : Both Short term and Long term trends are Up,
- Bright_Green : Both Short term and Long term trends are Up,
- Bright_Red : Both Short term and Long term trends are Down,
- Light_Red : Short term trend is Down and Long term trend is Up,
- Yellow : If ChopColor is selected yes, then all Price Bars occurring during Choppiness
  periods per the Trend Strength Label (discussed below) will be colored.

During uptrends, light red colors may indicate a pullback if the red cloud on the lower indicator  is  shrinking or above approximately -100 and then green/light_green bar colors continue. Otherwise, a possible trend reversal is indicated. The opposite applies for downtrends.

The lower indicator has cloud colors to indicate short term price action as green/red and long term as dark_green/dark_red.  A red cloud peeking out of the green upper cloud  or a green cloud peeking out of a red lower cloud can be a warning of a possible pullback or change in trend. Aggressive traders may possibly consider this as an early entry/exit signal.

The trend matching the coloring of the price bars is shown as dots on the zero line of the lower indicator. Orange dots shadowing the trend dots indicate a Bollinger Band/Keltner Channel Squeeze (provided by Mobius@MyTrade). An Orange Label indicates the Squeeze status and number of consecutive bars being squeezed. The longer the squeeze is lasting may indicate a larger move when it ends. The direction that price goes once the Squeeze ends is often the color of the Cloud during the Squeeze.

A Trend Strength label (also provided by Mobius@MyTrade) is worded Trending and color coded to be light_green (weak) and green (strong) for uptrends and light_red (weak) and red (strong) for downtrends. It is worded Choppy and color coded light_green/light_red for Choppiness.

As is traditional on TrendXplorer's blog, the thinkscript code is available in the comment section.

[Edited] Finally, when using price colors, another script is very helpful. priceLine plots a line that follows the close(last) price, so you can see where price is within a colored candle. It is also helpful in determining whether a previous candle/level has been breeched. It could be added as part of a thinkscript study, standalone or however one might deem. See the comment section for an example of priceLine as a separate study.