| Analytics > Indicators > Williams %R |
Williams %R indicator for the FinancialChart is a momentum indicator, which compares the current asset price to the highest price over the look back period. Its look-back is typically 14 periods. The indicator fluctuates between 0 and -100. It is the inverse of a fast Stochastic Oscillator. While the Williams %R displays the level of a stock's close relative to the highest high for the look-back period, the Stochastic Oscillator shows the level of a stock's close relative to the lowest low. Both the indicators show same lines, however scaling is different. It finds application in determining Overbought/Oversold levels, providing buy and sell signals, and momentum confirmations.
The following code snippet creates an instance of the WilliamsR class to use the indicator.
Dim wr As New WilliamsR() With { .Name = "WilliamsR" } Dim dataService__1 = DataService.GetService() Dim data = dataService__1.GetSymbolData("box") FinancialChart1.BeginUpdate() FinancialChart1.BindingX = "date" FinancialChart1.Binding = "close" FinancialChart1.Series.Add(New FinancialSeries()) FinancialChart1.ChartType = C1.Chart.Finance.FinancialChartType.Line FinancialChart1.DataSource = data FinancialChart1.Rendered += Function(s, a) financialChart2.AxisX.Min = FinancialChart1.AxisX.ActualMin financialChart2.AxisX.Max = FinancialChart1.AxisX.ActualMax End Function FinancialChart1.EndUpdate() financialChart2.BeginUpdate() financialChart2.ChartType = C1.Chart.Finance.FinancialChartType.Line financialChart2.BindingX = "date" financialChart2.Binding = "high,low,close" financialChart2.Series.Add(wr) financialChart2.Legend.Position = C1.Chart.Position.Bottom financialChart2.DataSource = data financialChart2.EndUpdate() period.Value = wr.Period
WilliamsR wr = new WilliamsR() { Name = "WilliamsR" }; var dataService = DataService.GetService(); var data = dataService.GetSymbolData("box"); financialChart1.BeginUpdate(); financialChart1.BindingX = "date"; financialChart1.Binding = "close"; financialChart1.Series.Add(new FinancialSeries()); financialChart1.ChartType = C1.Chart.Finance.FinancialChartType.Line; financialChart1.DataSource = data; financialChart1.Rendered += (s, a) => { financialChart2.AxisX.Min = financialChart1.AxisX.ActualMin; financialChart2.AxisX.Max = financialChart1.AxisX.ActualMax; }; financialChart1.EndUpdate(); financialChart2.BeginUpdate(); financialChart2.ChartType = C1.Chart.Finance.FinancialChartType.Line; financialChart2.BindingX = "date"; financialChart2.Binding = "high,low,close"; financialChart2.Series.Add(wr); financialChart2.Legend.Position = C1.Chart.Position.Bottom; financialChart2.DataSource = data; financialChart2.EndUpdate(); period.Value = wr.Period;
