Class MACDIndicator
To render an MACD indicator, create an instance of its class, and add it to TechnicalIndicators collection property and set the required properties.
Inherited Members
Namespace: Syncfusion.SfChart.XForms
Assembly: Syncfusion.SfChart.XForms.dll
Syntax
public class MACDIndicator : FinancialTechnicalIndicator, IThemeElement
Remarks
This indicator can be associated to a financial series in
SfChart by specifying the name of series using
SeriesName property. If the SeriesName
is specified, all the required properties such as
ItemsSource, XBindingPath,
High, Low, Open and
Close will be derived from the associated series.
In case, the SeriesName is not specified, all those required
properties need to be explicitly specified in MACDIndicator.
Examples
SfChart chart = new SfChart();
chart.PrimaryAxis = new NumericalAxis();
chart.SecondaryAxis = new NumericalAxis();
CandleSeries series = new CandleSeries();
series.name = "series";
ObservableCollection<ChartDataPoint> Data = new ObservableCollection<ChartDataPoint>
{
new ChartDataPoint(1, 30,35,20,25),
new ChartDataPoint(2, 90,100,10,20),
new ChartDataPoint(3, 20,90,10,80),
new ChartDataPoint(5, 10,0,80,70),
new ChartDataPoint(10, 25,20,49,12),
new ChartDataPoint(12, 68,60,30,50)
};
series.ItemsSource = Data;
chart.Series.Add(series);
chart.TechnicalIndicators.Add(new MACDIndicator(){SeriesName="series"});
Constructors
MACDIndicator()
Initializes a new instance of the MACDIndicator class.
Declaration
public MACDIndicator()
Fields
HistogramColorProperty
Gets or sets the HistogramColor
property.
Declaration
public static readonly BindableProperty HistogramColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LongPeriodProperty
Gets or sets the LongPeriod
property.
Declaration
public static readonly BindableProperty LongPeriodProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MACDLineColorProperty
Gets or sets the MACDLineColor
property.
Declaration
public static readonly BindableProperty MACDLineColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MACDTypeProperty
Gets or sets the MACDType
property.
Declaration
public static readonly BindableProperty MACDTypeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ShortPeriodProperty
Gets or sets the ShortPeriod
property.
Declaration
public static readonly BindableProperty ShortPeriodProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
SignalLineColorProperty
Gets or sets the SignalLineColor
property.
Declaration
public static readonly BindableProperty SignalLineColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
TriggerProperty
Gets or sets the Trigger
property.
Declaration
public static readonly BindableProperty TriggerProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Properties
HistogramColor
Gets or sets the fill color for the histogram.
Declaration
public Color HistogramColor { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Color | This property takes the Xamarin.Forms.Color as its value. |
LongPeriod
Gets or sets the long time period(no of days) for calculating EMA.
Declaration
public int LongPeriod { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | This property takes the System.Int32 as its value. |
MACDLineColor
Gets or sets the fill color for the MACD line.
Declaration
public Color MACDLineColor { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Color | This property takes the Xamarin.Forms.Color as its value. |
MACDType
Gets or sets the MACD type.
Declaration
public MACDType MACDType { get; set; }
Property Value
Type | Description |
---|---|
MACDType | This property takes the System.Int32 as its value. |
ShortPeriod
Gets or sets the short time period(no of days) for calculating EMA.
Declaration
public int ShortPeriod { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | This property takes the System.Int32 as its value. |
SignalLineColor
Gets or sets the fill color for the signal line.
Declaration
public Color SignalLineColor { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Color | This property takes the Xamarin.Forms.Color as its value. |
Trigger
Gets or sets the trigger value for the indicator.
Declaration
public int Trigger { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | This property takes the System.Int32 as its value. |