Skip to content

MACD Property

Summary

Gets the main MACD line (blue line).

Remarks

MACD line: difference between the 12 and 26 days EMAs

Signature

1
public abstract IndicatorDataSeries MACD {get;}

Return Value

IndicatorDataSeries

Declaring Type

cAlgo.API.Indicators.MacdCrossOver

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 //...
 private MacdCrossOver _macdCrossOver;
 [Output("MACD")]
 public IndicatorDataSeries Macd { get; set; }
 protected override void Initialize()
 {
     _macdCrossOver = Indicators.MacdCrossOver(LongCycle, ShortCycle, Period);
 }
 public override void Calculate(int index)
 {
     Macd[index] = _macdCrossOver.MACD[index];
     //...
 }

Last update: July 1, 2022

Comments