TASC 2012-07 | Long-Term Trading Using Exchange Traded Funds (HACOLT) (Vervoort)

Modified on 2019/02/16 17:37 by Eugene — Categorized as: TASC Traders Tips

Traders' Tip text

In "Long-Term Trading Using Exchange Traded Funds", author Sylvain Vervoort describes the evolution of his HACO indicator into a long-term version called HACOLT, and presents an application on a portfolio of ETFs. Based on Vervoort's original rules, the Strategy below contains configurable parameters to set the two periods (TEMA and Shorting LT Average) and the Candle Size factor.

Figure 1. Using BA (Boeing) shares to apply a HACOLT Strategy as presented by the author in Wealth-Lab 6.3.

  1. Simply drag and drop one of the general conditions on an entry or exit (specifically, “Indicator crosses above/below a Value), and then
  2. Click where indicated to select the SZO from the Indicators dialog.

Image

Wealth-Lab users who want to test the new HACOLT indicator on any markets including but not limited to ETFs, can download this example Strategy directly to Wealth-Lab. From the "Open Strategy" dialog (Ctrl-O), choose "Download..." to get all Strategies uploaded lately. Alternatively, the Strategy is also available for copying and pasting:



WealthScript Code (C#)


using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using TASCIndicators;

namespace WealthLab.Strategies { public class HACOLTStrategy : WealthScript { private StrategyParameter period; private StrategyParameter candlesize; private StrategyParameter ltaverage; public HACOLTStrategy() { period = CreateParameter("TEMA Period",55,2,100,10); candlesize = CreateParameter("Candle Size",1.1,0.01,5,0.5); ltaverage = CreateParameter("Shorting LT Average",60,1,200,20); } protected override void Execute() { HACOLT hacolt = HACOLT.Series(Bars, period.ValueInt, candlesize.Value, 2, ltaverage.ValueInt); ChartPane paneHACOLT = CreatePane(30,true,true); PlotSeries(paneHACOLT, hacolt, Color.FromArgb(255,138,43,226), LineStyle.Solid, 2); HideVolume();

for(int bar = hacolt.FirstValidValue; bar < Bars.Count; bar++) { bool buyLong = hacolt[bar] == 100; bool closeLong = hacolt[bar] == 0 || CrossUnder(bar, hacolt, 50); bool goShort = hacolt[bar] == 0; bool coverShort = hacolt[bar] == 100;

// The first trade if (Positions.Count == 0){ if ( buyLong ) BuyAtMarket( bar + 1 ); else if( goShort ) ShortAtMarket( bar + 1 ); } // Subsequent trades else { Position p = LastPosition; if ( p.PositionType == PositionType.Long ) { if ( closeLong ) { SellAtMarket( bar + 1, p ); if( goShort ) if( ShortAtMarket( bar+1 ) != null ) LastPosition.Priority = Close[bar]; } } else if ( coverShort ) { CoverAtMarket( bar + 1, p ); if( buyLong ) if( BuyAtMarket( bar+1 ) != null ) LastPosition.Priority = -Close[bar]; } } } } } }