Log in to see Cloud of Tags

Wealth-Lab Wiki

HMA (Hull MA)

RSS

Hull MA (HMA): Indicator Documentation

====Syntax====
DataSeries HullMA( DataSeries Series, int Period);

Parameter Description

Series  Data series used to produce the HMA calculation
Period  Period to average the data series

Description

The Hull Moving Average (HMA) was created by trader, businessman, mathematician, and IT expert Alan Hull. It is a combination of weighted moving averages (WMA) designed to be more responsive to current price fluctuations while still smoothing prices.

Alan Hull's description of HMA

Example

This example illustrates how to construct and plot the HMA.

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

namespace WealthLab.Strategies { public class HullMA : DataSeries { public HullMA ( DataSeries ds, int period ) : base(ds, "HullMA") { DataSeries SlowWMA = WMA.Series( ds, period ); DataSeries FastWMA = WMA.Series( ds, (int)(period/2) ); DataSeries hma = WMA.Series( ( FastWMA + ( FastWMA - SlowWMA ) ), (int)Math.Sqrt(period) ); for (int bar = period; bar < ds.Count; bar++) { this[bar] = hma[bar]; } }

public static HullMA Series( DataSeries ds, int period ) { HullMA _hma = new HullMA( ds, period ); return _hma; } }

public class HMAStrategy : WealthScript { private StrategyParameter paramPeriod; public HMAStrategy() { paramPeriod = CreateParameter( "Period", 20, 2, 100, 1 ); } protected override void Execute() { HullMA hma = new HullMA( Close, paramPeriod.ValueInt ); PlotSeries( PricePane, hma, Color.Blue, WealthLab.LineStyle.Solid, 1 ); } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.