home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
t
/
tas412.zip
/
BBAND.TAS
< prev
next >
Wrap
Text File
|
1991-11-26
|
2KB
|
56 lines
{ BBAND.TAS - This script computes BOLLINGER BANDS.
Bollinger bands are lines which are 'n' standard deviations away
from a 'p' day moving average of the close.
To change the value of 'n', change 'bband_devs' below. To
change the value of 'p', change 'bband_period' below.
NOTE- This script will use the optional GRAPH feature of TAS.
If it is not registered to run GRAPH's then it will terminate
on the SECOND graph.
If you wish to continue viewing graphs, see the REGISTER.DOC
file included with the TAS system. That file contains the
pricing and ordering information for the GRAPH feature.
}
#output_file 'bband.lst' n
#max_quotes 200
GRAPH_SWITCH = 1; {<--------- SET THIS TO 1 TO SEE GRAPHS}
bband_period = 20; { number of days in BBAND period }
bband_devs = 2; { number of STD DEVIATIONS about close}
bband_top : array; { top band }
bband_bot : array; { bottom band }
{
Top Bollinger Band
}
bband_top = bbandt(20,2);
{
Bottom Bollinger Band
}
bband_bot = bbandb(20,2);
{ Now, the rest is up to you. I have suppied a simple check to see
if the current close is over the top band or below the bottom band.
You can use these BBAND arrays to check for the narrowing of the
bands, tops or bottoms outside the bands, and bouncing off the
bands.
}
if over(c,bband_top) <= 0 then
begin
gosub dograph;
writeln(ticker,' BBAND upward breakout occurred');
end;
if over(bband_bot,c) <= 0 then
begin
gosub dograph;
writeln(ticker,' BBAND downward breakout occurred');
end;
return;
:dograph
if graph_switch = 0 then return;
opengraph(3,0,0);
sizegraph(2,1,1); { size the graphs 50%, 25%, 25%}
graph(bband_top,bband_bot,1);
graph(macd(),'Macd',macdtrigger(),'Trigger');
graph(adx(14),'ADX 14',PDI(14),'PDI 14',MDI(14),'MDI 14');
closegraph();
return;