You are on page 1of 1

Traders Tips - July 2006

http://www.traders.com/documentation/FEEDbk_docs/2006/07/Trad...

AMIBROKER: Wilson Relative Price Channel In "The Wilson Relative Price Channel," Leon Wilson presents a new application of the classic RSI. The coding for the relative price channel chart in AmiBroker Formula Language (AFL) is straightforward. Ready-to-use code for AmiBroker is presented here. To apply the formula, open Formula Editor, paste in the code, and press the "Apply Indicator" button. A sample chart can be found in Figure 5.

FIGURE 5: AMIBROKER, WILSON RELATIVE PRICE CHANNEL. This AmiBroker screenshot shows a weekly price chart of PAS (PepsiAmericas) with the Wilson relative price channel bullish band (gray) and bearish band (blue), reproducing the chart that Leon Wilson presented in his article.
Version(4.80); // requires version 4.80 Periods = Param("Channel Periods", 34, 1, 250 ); Smooth = Param("Smoothing", 1, 1, 55 ); Value2 = Param("Over Bought", 70, 50, 99 ); Value3 = Param("Over Sold", 30, 1, 50 ); Value4 = Param("Upper Neutral Zone", 55, 50, 99 ); Value5 = Param("Lower Neutral Zone", 45, 1, 50 ); r = RSI( Periods ); OB = EMA( r - Value2, Smooth ); OS = EMA( r - Value3, Smooth ); NzU = EMA( r - Value4, Smooth ); NzL = EMA( r - Value5, Smooth ); Ch1 = Close - Close * OB / 100; Ch2 = Close - Close * NzU / 100; Ch3 = Close - Close * NzL / 100; Ch4 = Close - Close * OS / 100; Plot( C, "Price", IIf( Close > Open, colorGreen, colorRed ), styleBar | styleThick ); Plot( Ch1, "", colorLightGrey ); Plot( Ch2, "", colorLightGrey, styleNoLabel | styleNoTitle ); PlotOHLC( Ch1, Ch1, Ch2, Ch2, "Upper Channel ", ColorRGB( 230, 230, 230), styleCloud ); Plot( Ch3, "", colorLightBlue ); Plot( Ch4, "", colorLightBlue, styleNoLabel | styleNoTitle ); PlotOHLC( Ch3, Ch3, Ch4, Ch4, "Lower Channel ", ColorRGB( 210, 210, 255), styleCloud ); Title = "{{NAME}} - {{INTERVAL}} {{DATE}} - {{VALUES}}";

--Tomasz Janeczko, AmiBroker.com www.amibroker.com

1 of 1

09/Sep/2010 10:02 AM

You might also like