WEALTH-LAB: HEIKIN-ASHI CANDLES OSCILLATOR LONG TERM (HACOLT)
- Details
- Parent Category: Departments
- Category: Traders' Tips
- Written by Eugene

In “Long-Term Trading Using Exchange Traded Funds” in this issue, author Sylvain Vervoort describes the evolution of his HACO indicator into a long-term version named HACOLT. He also presents an application of it to a portfolio of ETFs.
Based on Vervoort’s rules, the Wealth-Lab strategy shown here contains configurable parameters to set the two periods (TEMA and shorting LT average) and the candle size factor.
Wealth-Lab users who want to test the new HACOLT indicator on any market (including but not limited to ETFs) can download this sample strategy directly into Wealth-Lab. From the Open Strategy dialog (Ctrl-O), choose “Download” to get all strategies that have been uploaded recently. The strategy is also available for copying & pasting below.
C# Code:
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];
}
}
}
}
}
}
A sample chart is shown in Figure 4.

FIGURE 4: WEALTH-LAB, HEIKIN-ASHI CANDLES OSCILLATOR LONG TERM (HACOLT). Here is an example of applying Sylvain Vervoort’s HACOLT strategy to BA (Boeing) shares in Wealth-Lab 6.3.


Join us on Facebook
Follow us on Twitter