public static WilliamsR Series(Bars bars, int period) public WilliamsR(Bars bars, int period, string description)
DataSeries PctR = WilliamsR.Series( Bars, 14 ); PctR *= -1;
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Color the chart background for smoothed Williams %R oversold and overbought levels DataSeries PctR = WilliamsR.Series( Bars, 14 ); DataSeries SmoothR = WilderMA.Series( PctR, 4 ); ChartPane PctRPane = CreatePane( 35, true, true ); PlotSeries( PctRPane, PctR, Color.SaddleBrown, WealthLab.LineStyle.Solid, 1 ); PlotSeries( PctRPane, SmoothR, Color.Black, WealthLab.LineStyle.Solid, 1 ); Color RedBkg = Color.FromArgb(255, 227, 231); Color BlueBkg = Color.FromArgb(50,0,100,255); for(int bar = 20; bar < Bars.Count; bar++) { if( SmoothR[bar] < 20 ) SetBackgroundColor( bar, RedBkg ); else if( SmoothR[bar] > 80 ) SetBackgroundColor( bar, BlueBkg ); } } } }