| |
|
|
Function : BWI
Inputs: Len (Numeric), Stdev1(Numeric),
Stdev2(Numeric);
Vars: Upper(0), Lower(0), Avg(0);
Upper=BollingerBand(Close,Len,Stdev1);
Lower=BollingerBand(Close,Len,Stdev2); Avg=Xaverage(Close,Len);
Bwi=(Upper-Lower)/Avg;
|
Indicator: BWI
Inputs: Len(21), Stdev1(2), Stdev2(-2);
Plot1(BWI(Len,Stdev1,Stdev2),"BWI");
|
|
 |
 |
|
Function: $Lowerband
Input: Price(NumericSeries),
Length(NumericSimple), SDev(NumericSimple);
$Lowerband = Average(Price, Length) -
StdDev(Price, Length) * SDev
|
Function:
$Upperband
Input: Price(NumericSeries),
Length(NumericSimple), SDev(NumericSimple);
$Upperband = Average(Price, Length) +
StdDev(Price, Length) * SDev
|
Indicator: B I
Input: Price(C), Length(18), SDev(2); Vars: Upper(0),
Lower(0), Where(0);
Upper = 100 * (Price - $Lowerband(Price,
Length, SDev)); Lower = $Upperband(Price, Length, SDev) -
$Lowerband(Price, Length, SDev); If Lower <> 0 Then Where =
((Upper / Lower) - 50) * 2; Plot1(Where, "Where");
Plot2(100,"Upper"); Plot3(-100,"Lower");
|
|
 |
 |
|
Indicator: B II
Input: Price(C), Length(18), SDev(2); Vars: Upper(0),
Lower(0), Where(0);
Upper = 100 * (Price -BollingerBand(Price,
Length, -SDev)); Lower =BollingerBand(Price, Length, SDev)
-BollingerBand(Price, Length,-SDev); If Lower <> 0 Then Where
= ((Upper / Lower) -50) * 2; Plot1(Where, "Where");
Plot2(100,"Upper"); Plot3(-100,"Lower"); plot4(value0,"BB1");
|
Indicator: BB1
input: price(c), length(14), coeff(2); vars: BB1(0);
value1=average(price,length); {<========= light
bulb must flash here} value2=stddev(price,length); {<=========
light bulb must flash here} value3=value1-coeff*value2; if
value2<>0 then begin
BB1=100*(price-value3)/(coeff*value2)-100;
end;
plot1(BB1,"BB1");
|
Indicator: BB
II
input: price(c), length(14), coeff(2); vars: SumSqr(0),
Avg(0), Counter(0), BB2(0), xstddev(0);
if Length <> 0 then begin Avg =
Average(Price,Length); SumSqr = 0; for counter = 0 to Length -
1 begin SumSqr = SumSqr + (Price[counter]-Avg) *
(Price[counter]-Avg); end; xStdDev = SquareRoot(SumSqr /
Length); end else xStdDev = 0;
if XstdDev<>0 then begin
BB2=100*(price-Avg+coeff*xStdDev)/(coeff*xStdDev)-100; end;
plot1(BB2,"BB2");
|
|
 |
 |
|
input:avg(20),smooth(5);
var:r1(0),r2(0),bull(0),bear(0); r1 = iff(c[1]>0, h-l,
maxlist(o-c[1],h-l)); r2 = iff(c[1]<0, h-l,
maxlist(c[1]-o,h-l));
bull=iff(c=o, iff(h-c=c-l, iff(c[1]>o,
maxlist(h-o,c-l),r1), iff(h-c>c-l, iff(c[1]<o,
maxlist(h-c[1],c-l), h-o), r1)), iff(c<o,
iff(c[1]<o, maxlist(h-c[1],c-l), maxlist(h-o, c-l)),
r1));
bear=iff(c=o, iff(h-c=c-l, iff(c[1]<o,
maxlist(o-l,h-c),r2), iff(h-c>c-l, r2, iff(c[1]>o,
maxlist(c[1]-l,h-c), o-l))), iff(c<o, r2,
iff(c[1]>o, maxlist(c[1]-l,h-c), maxlist(o-l, h-c))));
plot1(xaverage(xaverage(bull,avg)-xaverage(bear,avg),smooth),"bbb");
|
| |
|