Tue05212013

Last update12:00:00 AM

BackHomeS&C MagazineDepartmentsTraders' Tips THINKORSWIM: HEIKIN-ASHI CANDLES OSCILLATOR LONG TERM (HACOLT)

THINKORSWIM: HEIKIN-ASHI CANDLES OSCILLATOR LONG TERM (HACOLT)

In his article in this issue, “Long-Term Trading Using Exchange Traded Funds,” author Sylvain Vervoort introduces his heikin-ashi candles oscillator long term (HACOLT).

This system is intended to be implemented on exchange traded funds. Because this security type is generally broad-based in its price drivers, Vervoort recommends a weekly charting approach for the most consistency in this type of application.

We have recreated this study in our proprietary scripting language, thinkScript, for your use. The display output is very straightforward, with a 100 max signal for a positive period, a 50 signal for a neutral period, and a zero for a negative period (Figure 2).

Image 1

FIGURE 2: THINKORSWIM, HEIKIN-ASHI CANDLES OSCILLATOR LONG TERM (HACOLT). In the display, a 100 max signal indicates a positive period, a 50 signals a neutral period, and a zero shows a negative period.

The code for the custom study is shown here along with instructions for applying it to a thinkorswim chart.

  1. From TOS charts, select “Studies” → “Edit Studies”
  2. Select the “Studies” tab in the upper left-hand corner
  3. Select “New” in the lower left-hand corner
  4. Name the strategy (such as “HACOLT”)
  5. Click in the script editor window, remove “plot Data = close;” and paste in the following:
    declare lower;
    input length = 55;
    input emaLength = 60;
    input candleSizeFactor = 1.1;
    rec HAopen = compoundValue(1, (HAopen[1] + ohlc4) / 2, ohlc4);
    def HAclose = (HAopen + Max(high, HAopen) + Min(low, HAopen) + ohlc4) / 4;
    def TEMAHAclose = TEMA(HAclose, length);
    def TEMAhl2 = TEMA(hl2, length);
    def HAcloseSmooth = 2 * TEMAHAclose - TEMA(TEMAHAclose, length);
    def hl2Smooth = 2 * TEMAhl2 - TEMA(TEMAhl2, length);
    def shortCandle = AbsValue(close - open) < (high - low) * candleSizeFactor;
    def keepn1 = (HAclose >= HAopen and HAclose[1] >= HAopen[1]) or close >= HAclose or high > high[1] or low > low[1] or hl2Smooth >= HAcloseSmooth;
    def keepall1 = keepn1 or (keepn1[1] and close >= open or close >= close[1]);
    def keep13 = shortCandle and high >= low[1];
    def utr = keepall1 or (keepall1[1] and keep13);
    def keepn2 = HAclose < HAopen and HAclose[1] < HAopen[1] or hl2Smooth < HAcloseSmooth;
    def keep23 = shortCandle and low <= high[1];
    def keepall2 = keepn2 or (keepn2[1] and close < open or close < close[1]);
    def dtr = keepall2 or (keepall2[1] and keep23);
    def upw = dtr == 0 and dtr[1] and utr;
    def dnw = utr == 0 and utr[1] and dtr;
    rec upwWithOffset = if upw != dnw then upw else upwWithOffset[1];
    def Buy = upw or (!dnw and (if IsNaN(upwWithOffset) then 0 else upwWithOffset));
    def LongTermSell = close < ExpAverage(close, emaLength);
    rec Neutral = Buy or (if LongTermSell then 0 else Neutral[1]);
    plot HACOLT = if Buy then 100 else if Neutral then 50 else 0;
    
  6. Select OK and you are good to go! Your study will appear in the list of available studies on the “Edit studies and strategies” menu. To add it to your chart, simply doubleclick on its entry on the list.

—thinkorswim
A division of TD Ameritrade, Inc.
www.thinkorswim.com


To read the entire issue click here and subscribe today!

PTSK — The Professional Traders' Starter Kit
Home| Working Money Magazine | S&C Magazine | Traders.com Advantage | Online Store | Traders’ Resource
Add a Product to Traders’ Resource | Message Boards | Subscribe/Renew | Free Trial Issue | Article Code | Search

DEPARTMENTS: Advertising | Editorial | Circulation | Employment | Contact Us | BY PHONE: (206) 938-0570

Join us on Facebook     Follow us on Twitter     Follow Us on StockTwits

Bookmark and ShareCopyright © 1996-2013 Technical Analysis, Inc. All rights reserved. Read our disclaimer & privacy statement.

SUBSCRIBE TO OUR FREE
EMAIL NEWSLETTER!