home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
finance
/
tas515dm.zip
/
EXAMPLES.ZIP
/
BASE40G.TAS
< prev
next >
Wrap
Text File
|
1992-01-04
|
2KB
|
62 lines
{BASE40G.tas} {Written by Domenic Bianco Prodigy # CXGV38A
01/04/92}
{This script compares the current price to the average price
at the 5 day moving average 40 trading days ago.
Output is sorted and printed.}
#OUTPUT_FILE 'LPT1' n
pmov50:array;
PMOV50:=MOV(C,50,'S');
pmov5:array;
pmov5:=mov(c,5,'s');
hi:=hhv(h,200);
lo:=llv(l,30);
vmov50:array;
vmov50:=MOV(V,50,'S');
P30:=pmov5[-40];
CHG:=(c-p30)/c*100
chg50=(c-pmov50)/c*100
chghi=(c-hi)/c*100
chgv=(v-vmov50)/vmov50*100
if c>.851*hi and c>=.98*pmov50 and C>.951*Pmov50 and C<=1.051*Pmov50
begin
sortout(hi,lo,Ticker,C[0],PMOV50,P30,V[0],VMOV50,chgv,chg50,chghi);
pgraph='y' {change to something else to turn off graph}
if pgraph='y'
begin
opengraph(3);
sizegraph(4,3,1);
graph(1,'PRICE',mov(c,50,'s'),'50Day MA',mov(c,200,'s'),'200DayMA',
mov(c,5,'s'),'5 Day MA');
graph(1,'PRICE',
bbandt(20,2),'BBand Top',
bbandb(20,2),'BBand Bottom');
graph(v,'VOLUME',vmov50,'50day MA');
closegraph();
end
end
IF last_ticker
begin
{writeln(' 1 2 3 4 5
6');
writeln('01234567890112345678901234567890123456789012345678901234567890');}
writeln(' A B C D E F G H I J K');
Writeln('----------------------------------------------------------');
writeln('< P R I C E > < Volume > Dvs ');
writeln(' High Low Symbol Recent Avg50 Avg40 RcntAvg50 Pct E A');
writeln('====== ==== ====== ====== ===== ===== ========= ========');
sorton(10,'a')
sortget(V1,V2,V3,V4,V5,V6,v7,v8,v9,v10,v11);
str1='%5.2f %5.2f %s %5.2f %5.2f %5.2f %4.0f %4.0f %3.0f %1.0f';
str2=str1 + '%4.0f\n';
sortprint(str2);
writeln(' ');
writeln('C is most recent recorded closing price');
writeln('High - last 200, Low - last 30 trading days');
writeln('Avg40 is the 5 day mov avg at the close 40 trading days ago')
writeln('Avg50 is the moving average of price and volume');
writeln('Col I J and K are % values');
writeln('Price is filtered on c>=50 day moving average)');
writeln('and [1.05*Avg40] < C > [.95*Avg40] and c>[.85*High]');
writeln(' \p');
END