IIndicatorsAccessor.DoubleExponentialMovingAverage
method · IIndicatorsAccessor · cAlgo.API.Internals
DesktopCLICloud
The Double Exponential Moving Average (DEMA) is a combination of smoothed exponential moving averages (EMA) and a basic EMA
Definition
DoubleExponentialMovingAverage DoubleExponentialMovingAverage(DataSeries source, int periods)
api.Indicators.DoubleExponentialMovingAverage(source: DataSeries, periods: int) -> DoubleExponentialMovingAverage
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
source | DataSeries | DataSeries | The source data used for calculation. |
periods | int | int | The periods used for the calculation. |
Returns DoubleExponentialMovingAverage — The DEMA indicator instance.
Examples
var dema = Indicators.DoubleExponentialMovingAverage(Bars.ClosePrices, 20);
Print("DEMA(20): {0}", dema.Result.LastValue);
dema = api.Indicators.DoubleExponentialMovingAverage(api.Bars.ClosePrices, 20)
api.Print(f"DEMA(20): {dema.Result.LastValue}")