DXCommodityChannelIndexIndicator Class
The Commodity Channel Index oscillator indicator.
Namespace: DevExpress.Xamarin.iOS.Charts
Assembly: DevExpress.Xamarin.iOS.Charts.dll
NuGet Package: DevExpress.XamarinForms.Charts
Declaration
public class DXCommodityChannelIndexIndicator :
DXCalculatedSeries
Remarks
This indicator looks as follows:
Note
Constant lines display the Oversold (-100) and Overbought (100) indicator values.
How to: Specify Indicator Data
This example demonstrates how to implement the calculated series’ data source:
// In the ViewDidLoad method.
DXStockSeries stockSeries = InitStock();
this.chart.AddSeries(stockSeries);
this.indicatorChart.AddSeries(
new DXCommodityChannelIndexIndicator {
Data = new CalculatedSeriesData(stockSeries),
PointsCount = 14,
DisplayName = "ATR (14)",
ShowInLegend = true
}
);
// ...
public class CalculatedSeriesData: DXCalculatedSeriesData {
DXSeries series;
public CalculatedSeriesData(DXSeries series) {
this.series = series;
}
public override DXSeries Source => series;
}
The code above uses the classes and members below:
Symbol | Description |
---|---|
| The Commodity Channel Index oscillator indicator. |
Gets or sets data the series display on the Chart. | |
|
Important
The indicator requires the DXFinancialSeriesData type of the source series’ data, because this indicator utilizes High, Low, and Close values to calculate indicator point values.
How to: Configure Indicator Hint Options
The chart Hint interacts with series to request values to display, to ask series what axis lines the Crosshair should display, etc:
The following code specifies how the hint displays the series:
series.HintOptions = new DXSeriesCrosshairOptions {
PointTextPattern = "{S}: {V$#.#}",
ShowInLabel = true,
AxisLineHidden = false,
AxisLabelHidden = false,
};
The series can utilize the classes and properties below to configure how the hint displays it:
Symbol | Description |
---|---|
| |
| |
| |
| |
| |
|
Note
Properties the DXSeriesCrosshairOptions class introduces do not affect the hint when the hint’s Behavior is set to DXTooltipHintBehavior. At the same time, all properties the class inherits from its parent influence the hint.
How to: Manage the Indicator Appearance
The series style provides the following parameters that specify a series’ appearance:
The code below customizes the Commodity Channel Index indicator’s appearance:
indicator.Style = new DXLineIndicatorStyle {
Stroke = UIColor.FromRGB(0.898f, 0.224f, 0.208f),
StrokeThickness = 3,
};
This code utilizes the following classes and members:
Symbol | Description |
---|---|
| |
| |
| |
|