Skip to content

MovingAverageType

Summary

An enumeration of the different MovingAverage weighting (smoothing) methods.

Signature

1
public enum MovingAverageType

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 using cAlgo.API;
 using cAlgo.API.Indicators;
 namespace cAlgo
 {
     // A sample indicator that shows how to use different types of moving average
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class MovingAverageTypeSample : Indicator
     {
         private MovingAverage _ma;
         [Parameter("Type", DefaultValue = MovingAverageType.Simple)]
         public MovingAverageType MovingAverageType { get; set; }
         [Output("Main")]
         public IndicatorDataSeries Result { get; set; }
         protected override void Initialize()
         {
             _ma = Indicators.MovingAverage(Bars.ClosePrices, 14, MovingAverageType);
         }
         public override void Calculate(int index)
         {
             Result[index] = _ma.Result[index];
         }
     }
 }

Fields

Simple

Summary

Use uniform weighting. Represents indicator oftype.

Signature

1
public static MovingAverageType Simple;

Return Value

MovingAverageType

Examples

1
2
 [Parameter("MAType", DefaultValue = MovingAverageType.Simple)]
 public MovingAverageType MaType { get; set; }

Exponential

Summary

Use exponential weighting. Represents indicator oftype.

Signature

1
public static MovingAverageType Exponential;

Return Value

MovingAverageType

Examples

1
2
 [Parameter("MAType", DefaultValue = MovingAverageType.Exponential)]
 public MovingAverageType MaType { get; set; }

TimeSeries

Summary

Represents indicator oftype.

Signature

1
public static MovingAverageType TimeSeries;

Return Value

MovingAverageType

Examples

1
2
 [Parameter("MAType", DefaultValue = MovingAverageType.TimeSeries)]
 public MovingAverageType MaType { get; set; }

Triangular

Summary

Represents indicator oftype.

Signature

1
public static MovingAverageType Triangular;

Return Value

MovingAverageType

Examples

1
2
 [Parameter("MAType", DefaultValue = MovingAverageType.Triangular)]
 public MovingAverageType MaType { get; set; }

VIDYA

Summary

VIDYA (Volatility Index Dynamic Average) variable length weighting. Represents indicator oftype.

Signature

1
public static MovingAverageType VIDYA;

Return Value

MovingAverageType

Examples

1
2
 [Parameter("MAType", DefaultValue = MovingAverageType.VIDYA)]
 public MovingAverageType MaType { get; set; }

Weighted

Summary

Represents indicator oftype.

Signature

1
public static MovingAverageType Weighted;

Return Value

MovingAverageType

Examples

1
2
 [Parameter("MAType", DefaultValue = MovingAverageType.Weighted)]
 public MovingAverageType MaType { get; set; }

WilderSmoothing

Summary

Represents indicator oftype.

Signature

1
public static MovingAverageType WilderSmoothing;

Return Value

MovingAverageType

Examples

1
2
 [Parameter("MAType", DefaultValue = MovingAverageType.WilderSmoothing)]
 public MovingAverageType MaType { get; set; }
1
 private MovingAverageType _wilderSmoothing = MovingAverageType.WilderSmoothing;

Hull

Summary

Represents indicator oftype.

Signature

1
public static MovingAverageType Hull;

Return Value

MovingAverageType

Examples

1
2
 [Parameter("MAType", DefaultValue = MovingAverageType.Hull)]
 public MovingAverageType MaType { get; set; }
1
 private MovingAverageType _hull = MovingAverageType.Hull;