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

Re: Intraday Intensity



PureBytes Links

Trading Reference Links

Russell,

Here is a chunk of code I did sometime ago to implement what
John Bollinger presented and what he called a 21-day volume
normalized average.  If its not the same logic, that you are
looking for then at least it gives you an idea on how to
overcome the divide by zero problem:  In this example I was
looking at data3.


{*******************************************************************
21 normalized average
*******************************************************************}
var: NorAverage(21);
var: Avg21(0);
value11 = (2*Close of data3 - High of data3 - Low of data3);
if value11  <> 0 then value22 = value11/(High of data3-Low of data3 )*Volume of data3 else value22 = value22[1];
Avg21 = average(value22,NorAverage)/average(Volume of data3,NorAverage)*100;
var: bull21(false),bear21(false);
if Avg21 < average(Avg21,6) then begin 
        if bull21 then If Debug = True then MessageLog(" 21 Day Average is Bearish");  
        bear21 = true; 
        bull21 = false; 
        end;
if Avg21 > average(Avg21,6) then begin 
        if bear21 then If Debug = True then MessageLog(" 21 Day Average is Bullish"); 
        bear21 = false;
        bull21 = true;
        end;



Regards,
Ernie
ebonugli@xxxxxxxx