Skip to content

KaufmanAdaptiveMovingAverage

interface cAlgo.API.Indicators

DesktopCLICloud

The Kaufman's Adaptive Moving Average (KAMA) indicator is a type of adaptive moving average designed to adjust its smoothing factor based on market volatility

Definition

public interface KaufmanAdaptiveMovingAverage

Namespace: cAlgo.API.Indicators · Group: Indicators · Implements: MovingAverage, StandardIndicator

Examples

private KaufmanAdaptiveMovingAverage _kama;

protected override void OnStart()
{
    _kama = Indicators.KaufmanAdaptiveMovingAverage(Bars.ClosePrices, 10, 2, 30);
}

protected override void OnBar()
{
    if (Bars.ClosePrices.Last(1) > _kama.Result.Last(1))
        Print("Close is above KAMA: {0}", _kama.Result.Last(1));
}
def on_start(self):
    self.kama = api.Indicators.KaufmanAdaptiveMovingAverage(api.Bars.ClosePrices, 10, 2, 30)

def on_bar(self):
    if api.Bars.ClosePrices.Last(1) > self.kama.Result.Last(1):
        api.Print(f"Close is above KAMA: {self.kama.Result.Last(1)}")

Inherited members

From MovingAverage: Result

From StandardIndicator: AddToChart, Symbol, TimeFrame, Bars