[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Williams %R



PureBytes Links

Trading Reference Links

Peter Carr posted an AFL for the Williams %R indicator a few months ago.

Thanks Pete, this gave me a helpful starting point. After comparing the 
charts to those from www.stockcharts.com I found Petes formula didn't 
match. I updated the formula as show below which does match:

=== orignal AFL ===========
days = 20;
num = hhv( close, days ) - close;
den = hhv( close, days ) - llv( close, days );
rate = 100 - (num/den * 100);
graph0 = rate;
graph1 = ema( rate, 10 );


=== Fixed ============
days = 10;
num = hhv( high, days ) - close;
den = hhv( high, days ) - llv( low, days );
rate = (num/den) * 100;
//rate = (num/den) * -100;
graph0 = rate;
graph1 = ema( rate, 10 );

Note the line where rate is calculated. Williams %R is supposed to range 
from 0 to -100. However Tomasz program won't put indicator lines at -20 and 
-80 which is the normal crossover points for this indicator, so I adjusted 
the output to 0 to 100. This provides the same visual results and allows 
the correct placement of grid lines.

Uncomment the second rate line to use the correct formula with negative 
numbers.

The scaling in indicator builder should be min: 100, Max 0
Grid lines: +20/80, 50


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com