Partial Public Class Indicators
Inherits UserControl
Private dataService As DataService = dataService.GetService()
Private cci As New CCI() With {
Key.SeriesName = "CCI"
}
Public Sub New()
InitializeComponent()
End Sub
Public ReadOnly Property Data() As List(Of Quote)
Get
Return dataService.GetSymbolData("box")
End Get
End Property
Public ReadOnly Property IndicatorType() As List(Of String)
Get
Return New List(Of String)() From {
"Commodity Channel Index"
}
End Get
End Property
Private Sub OnIndicatorTypeSelectionChanged(sender As Object, e As SelectionChangedEventArgs)
Dim ser As FinancialSeries = Nothing
If cbIndicatorType.SelectedIndex = 0 Then
ser = cci
End If
If ser IsNot Nothing AndAlso Not indicatorChart.Series.Contains(ser) Then
indicatorChart.BeginUpdate()
indicatorChart.Series.Clear()
indicatorChart.Series.Add(ser)
indicatorChart.EndUpdate()
End If
End Sub
Private Sub OnFinancialChartRendered(sender As Object, e As C1.WPF.Chart.RenderEventArgs)
If indicatorChart IsNot Nothing Then
indicatorChart.AxisX.Min = DirectCast(financialChart.AxisX, IAxis).GetMin()
indicatorChart.AxisX.Max = DirectCast(financialChart.AxisX, IAxis).GetMax()
End If
End Sub
End Class