Skip to content

IIndicatorsAccessor.HullMovingAverage

method · IIndicatorsAccessor · cAlgo.API.Internals

DesktopCLICloud

The Hull Moving Average is a more responsive moving average that nearly removes lag and improves smoothing at the same time.

Definition

HullMovingAverage HullMovingAverage(DataSeries source, int periods)
api.Indicators.HullMovingAverage(source: DataSeries, periods: int) -> HullMovingAverage

Parameters

Name C# type Python type Description
source DataSeries DataSeries The source data used for calculation.
periods int int The value of the periods used for calculation.

Returns HullMovingAverage — Hull Moving Average indicator instance

Examples

var hma = Indicators.HullMovingAverage(Bars.ClosePrices, 14);
var isRising = hma.Result.Last(1) > hma.Result.Last(2);
Print("HMA(14): {0}, rising: {1}", hma.Result.Last(1), isRising);
hma = api.Indicators.HullMovingAverage(api.Bars.ClosePrices, 14)
isRising = hma.Result.Last(1) > hma.Result.Last(2)
api.Print(f"HMA(14): {hma.Result.Last(1)}, rising: {isRising}")