Partial Public Class Indicators
Inherits Page
Private dataService As DataService = dataService.GetService()
Private cci As New CCI() With {
.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
Sub OnIndicatorTypeSelectionChanged(sender As Object, e As SelectionChangedEventArgs)
Dim ser As FinancialSeries = Nothing
If cbIndicatorType.SelectedIndex = 2 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
Sub OnCbPeriodValueChanged(sender As Object, e As PropertyChangedEventArgs(Of Double))
wi.Period = CType(e.NewValue, Integer)
cci.Period = wi.Period
rsi.Period = cci.Period
atr.Period = rsi.Period
End Sub
Sub OnFinancialChartRendered(sender As Object, e As RenderEventArgs)
If indicatorChart IsNot Nothing Then
indicatorChart.AxisX.Min = (CType(financialChart.AxisX, IAxis)).GetMin()
indicatorChart.AxisX.Max = (CType(financialChart.AxisX, IAxis)).GetMax()
End If
End Sub
End Class