MovingAverage.Result
property · MovingAverage · cAlgo.API.Indicators
DesktopCLICloud
The resulting time series of the calculation.
Definition
IndicatorDataSeries Result {get;}
movingAverage.Result: IndicatorDataSeries
Returns IndicatorDataSeries
Examples
var movingAverage = Indicators.MovingAverage(Bars.ClosePrices, 20, MovingAverageType.Exponential);
if (Bars.ClosePrices.Last(1) > movingAverage.Result.Last(1))
Print("Close is above the moving average: {0}", movingAverage.Result.Last(1));
movingAverage = api.Indicators.MovingAverage(api.Bars.ClosePrices, 20, MovingAverageType.Exponential)
if api.Bars.ClosePrices.Last(1) > movingAverage.Result.Last(1):
api.Print(f"Close is above the moving average: {movingAverage.Result.Last(1)}")