home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
finance
/
tas515dm.zip
/
EXAMPLES.ZIP
/
OVERMA.TAS
< prev
next >
Wrap
Text File
|
1992-08-29
|
1KB
|
38 lines
{ OVERMA.TAS
This TAS script computes and graphs the percentage number of stocks
over their N day simple moving average.
You can set the number of days in the moving average by specifying
@Period=xx
on the command line, where 'xx' is the number of periods.
The default is 30.
Author : Martin Moore, 8/29/92
Based on a request by M. Schotter
}
#max_quotes 200
NA : array; { Number Over moving average array }
PR : array; { Price total array }
MA : array;
If Period = 0 Then
Period = 30;
TickCount = TickCount + 1;
MA = Mov(C,Period,'S');
For I = Period; I <= Quote_Count ; I = I + 1;
Begin
If C[I] > MA[I] then { If Close Greater Than Moving Average }
NA[I] = NA[I] + 1; { ...Add one to Number Abover Moving Average}
PR[I] = PR[i] + C[I]; { Bump Price Array }
End
If Last_Ticker then
Begin
NA = MulBy(DivBy(NA,TickCount),100.0);
OpenGraph(2);
Graph(NA, 'Percent above '+Format(period,'%3.0f')+' Day Moving Average');
Graph(PR, 'Overal Price Price');
CloseGraph();
End;