PureBytes Links
Trading Reference Links
|
Well, thanks to the contributions of many folks I have
something that looks interesting at first blush.
The following indicator plots the theoretical high and
low for every bar, based on the N day volatility of N days
ago, at 95% C.F.
The bands are quite volatile and could be smoothed.
Make sure you set scaling to Same as price.
The volatility function, AV_VtyCC2, is also provided below.
Substitute your own as it suits. (I seem to have a bunch,
none of which agree with each other.)
++++++++++++++++++++++++++
{CV_Theoretical Range}
Inputs: Len(20), YrEquals(252), CF(2) ;
Vars: Multiplier(0) ;
Multiplier = ExpValue(0.01*AV_VtyCC2(Len, YrEquals) * SquareRoot(Len/
YrEquals)) - 1 ;
Value1 = (High * (1 + CF*Multiplier))[Len] ;
Value2 = (Low * (1 - CF*Multiplier))[Len] ;
Plot1(Value1,"Top");
Plot2(Value2,"Bott");
++++++++++++++++++++++++++
{AV_VtyCC2
Automatically adjusts to daily or weekly bars;
Allows you to input the number of days (Annual =250 or 365)
}
Inputs: LookBk(NumericSimple), Annual(NumericSimple);
Vars: HVol(0), Per(0);
If DataCompression <= 2 then Per = 1;
If DataCompression = 3 then Per = 7;
HVol = StdDev(Log(C/ C[1]), LookBk) * SquareRoot(Annual/ Per);
AV_VtyCC2 = HVol*100;
|