Syntax
public WilsonRSIChannel(DataSeries ds, int rsiperiod, int smoothperiod, double cord, string description)
public static WilsonRSIChannel Series(DataSeries ds, int rsiperiod, int smoothperiod, double cord)
Parameter Description
ds |
Source Series |
rsiperiod |
RSI period
|
smoothperiod |
EMA smoothing period. Keep this low as higher numbers increase delay.
|
cord |
Cord is the RSI value between 0 and 100
|
Description
The Wilson (Relative) Price Channel from Leon Wilson's article in the July 2006 issue of
Stocks & Commodities magazine. The channel quantifies the relationship
between price action and RSI. In reality, the channels are reverse-engineered RSI constant values displayed on price. Run the example for clarification.
Example
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using TASCIndicators;
namespace WealthLab.Strategies
{
public class MyStrategy : WealthScript
{
protected override void Execute()
{
DataSeries ds = Close;
int rsiPer = 21;
int emaPer = 1;
DataSeries obought = WilsonRSIChannel.Series(ds, rsiPer, emaPer, 70);
DataSeries nzu = WilsonRSIChannel.Series(ds, rsiPer, emaPer, 55);
DataSeries nzl = WilsonRSIChannel.Series(ds, rsiPer, emaPer, 45);
DataSeries osold = WilsonRSIChannel.Series(ds, rsiPer, emaPer, 30);
PlotSeriesDualFillBand(PricePane, obought, nzu, Color.LightGray, Color.Blue, Color.LightGray, LineStyle.Solid, 1);
PlotSeriesDualFillBand(PricePane, osold, nzl, Color.LightBlue, Color.LightBlue, Color.LightBlue, LineStyle.Solid, 1);
ChartPane rsiPane = CreatePane( 50, false, true );
PlotSeries(rsiPane, RSI.Series(Close, rsiPer), Color.Blue, LineStyle.Solid, 2);
SetPaneMinMax( rsiPane, 30, 80 );
int b = Bars.Count - 1;
double[] rect = { b, 55, b, 70, 0, 70, 0, 55 };
DrawPolygon(rsiPane, Color.LightGray, Color.LightGray, LineStyle.Invisible, 1, true, rect);
double[] rect2 = { b, 30, b, 45, 0, 45, 0, 30 };
DrawPolygon(rsiPane, Color.LightBlue, Color.LightBlue, LineStyle.Invisible, 1, true, rect2);
HideVolume();
}
}
}