TASC 2011-10 | The JK HiLo Index (Kaeppel)

Modified on 2011/09/14 08:34 by Eugene — Categorized as: IndexDefinitions, TASC Traders Tips

Traders' Tip text

The JK HiLo index synthesizes two market breadth indicators to arrive at new tool for supporting buy/sell decisions. Although it's based on a pretty wide sample of NASDAQ symbols, what if you trade a different universe of stocks? How about futures traders? And what's with its applicability to overseas markets? In addition, Kaeppel's original JKHL formula contains two hard-coded thresholds in its construction which may not necessarily be applicable outside the NASDAQ watchlist. These numbers can become out of sync when applied to other portfolios.

Thinking about these considerations, we will introduce a tweak to enhance the presented formula. Since Wealth-Lab allows to easily create your own unique market indices, code below focuses on making JKHL both adaptive and universal enough to capture the breadth of a custom "universe" of symbols – not just the NASDAQ. The idea behind determining the buy and sell thresholds dynamically is based on applying Bollinger Bands with upper and lower boundaries placed two standard deviations above and below a long-term SMA of the JKHL. Finally, the constant thresholds used in the “adjusted high/low logic index” formula can be replaced with custom values.


Figure 1. A Wealth-Lab Developer 6.2 chart showing the JK HiLo Index chart markup applied to a Daily chart. The JKHL and its underlying indices here are built against the S&P 100 stocks, using 20-day new highs/lows. Our adaptive thresholds (colored bluish) are constructed using 100-day Bollinger Bands. Selling opportunities are highlighted in green.

Before the JKHL can be used in Wealth-Lab as an aid in trading systems, several easy steps are required:

  1. Install the MS123 IndexDefinitions library from the Extensions section of our website www.wealth-lab.com and restart Wealth-Lab.
  2. In the Index Manager tool, select your favorite DataSet and pick "JK HiLo Index" from the list of available indices to create the JKHL. Type in "JKHL" as the Index Name. As can be seen on Figure 2, everything about the JKHL is made configurable: the new high/low period, the SMA period, and the two thresholds used when building the "adjusted high/low logic index".
  3. Copy/paste the included Strategy's C# code or simply let Wealth-Lab do the job: in "Open Strategy" dialog, click "Download" to get the strategy code.


Figure 2. The Index Manager dialog for creating the configurable JKHL index.

WealthScript Code (C#)

using System;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;

namespace WealthLab.Strategies { public class JKHiLoIndex : WealthScript { protected override void Execute() { DataSeries J = GetExternalSymbol("%JKHL",true).Close; //Adaptive thresholds for the JK HiLo Index BBandUpper bbu = BBandUpper.Series( J, 100, 2.0 ); BBandLower bbl = BBandLower.Series( J, 100, 2.0 );

// Plotting JK HiLo Index HideVolume(); ChartPane jPane = CreatePane(45,true,true); PlotSeries( jPane, J, Color.DarkBlue, LineStyle.Solid, 2); PlotSeriesFillBand( jPane, bbu, bbl, Color.Blue, Color.FromArgb( 30, Color.Blue ), LineStyle.Solid, 1 ); for(int bar = bbu.FirstValidValue; bar < Bars.Count; bar++) { bool sellZone = J[bar] >= bbu[bar]; bool buyZone = J[bar] <= bbl[bar]; if( sellZone ) SetBackgroundColor( bar, Color.FromArgb( 30, Color.Green ) ); if( buyZone ) SetBackgroundColor( bar, Color.FromArgb( 30, Color.Red ) ); } } } }