Class MovingAverageCrossover
- Namespace
- StockSharp.Algo.Indicators
- Assembly
- StockSharp.Algo.dll
Moving Average Crossover indicator.
[Display(ResourceType = typeof(LocalizedStrings), Name = "MAC", Description = "MovingAverageCrossover")]
public class MovingAverageCrossover : BaseIndicator, IIndicator, IPersistable, ICloneable<IIndicator>, ICloneable
- Inheritance
-
MovingAverageCrossover
- Implements
-
IPersistableICloneable<IIndicator>
- Derived
- Inherited Members
- Extension Methods
Constructors
MovingAverageCrossover()
Initializes a new instance of the MovingAverageCrossover.
public MovingAverageCrossover()
MovingAverageCrossover(SimpleMovingAverage, SimpleMovingAverage)
Initializes a new instance of the MovingAverageCrossover.
public MovingAverageCrossover(SimpleMovingAverage fastMa, SimpleMovingAverage slowMa)
Parameters
fastMa
SimpleMovingAverageFast moving average.
slowMa
SimpleMovingAverageSlow moving average.
Properties
LongPeriod
Longest Moving Average period.
[Display(ResourceType = typeof(LocalizedStrings), Name = "Long", Description = "LongPeriod", GroupName = "General")]
public int LongPeriod { get; set; }
Property Value
Measure
public override IndicatorMeasures Measure { get; }
Property Value
NumValuesToInitialize
Number of values that need to be processed in order for the indicator to initialize (be IsFormed equals true). null if undefined.
public override int NumValuesToInitialize { get; }
Property Value
ShortPeriod
Shortest Moving Average period.
[Display(ResourceType = typeof(LocalizedStrings), Name = "Short", Description = "ShortPeriod", GroupName = "General")]
public int ShortPeriod { get; set; }
Property Value
Methods
CalcIsFormed()
Calc IsFormed.
protected override bool CalcIsFormed()
Returns
Load(SettingsStorage)
Load settings.
public override void Load(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
OnProcess(IIndicatorValue)
To handle the input value.
protected override IIndicatorValue OnProcess(IIndicatorValue input)
Parameters
input
IIndicatorValueThe input value.
Returns
- IIndicatorValue
The resulting value.
Reset()
To reset the indicator status to initial. The method is called each time when initial settings are changed (for example, the length of period).
public override void Reset()
Save(SettingsStorage)
Save settings.
public override void Save(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
ToString()
public override string ToString()