home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
finance
/
tas515dm.zip
/
TAS514.EXE
/
lha
/
MA2.TAS
< prev
next >
Wrap
Text File
|
1993-03-31
|
1KB
|
56 lines
#Output_File ma2.lst
DumpPoints : String;
GraphRequest : String;
ShortMA : Array;
LongMA : Array;
{
This prologue section asks for the short and long moving average
periods. It also asks if you want to display all data points
and whether you want to graph the results
}
Prolog Begin
DumpPoints = 'Y';
GraphRequest = 'Y';
Points = 100;
If Not Defined(SPeriod) Then
Begin
SPeriod =5;
LPeriod =10;
Ask('Enter the shorter moving average period', SPeriod,
'Enter the longer moving average period ', LPeriod,
'Do you want to display each day?',DumpPoints,
'Do you want to graph each security?',GraphRequest,
'Data points to load for each? ',Points);
End;
MaxQuotes(Points);
End;
ShortMA = Mov(C,SPeriod,'E');
LongMA = Mov(C,LPeriod,'E');
If DumpPoints = 'Y' then
Begin
Heading = 'Date Open High Low Close '
+ 'Mavg1 Mavg2 Mavg1/Mavg2';
WriteLn(Heading);
For Each Point Starting at 1 Begin
Writeln(DateStr(Dates[0]),
Open,
High,
Low,
Close,
ShortMA,
LongMA,
ShortMA/LongMA);
End;
End;
If GraphRequest = 'Y' Then
Begin
OpenGraph(1);
Graph(1,
ShortMA,Expand('%d bar EMA',SPeriod),
LongMA,Expand('%d bar EMA',LPeriod));
CloseGraph();
End;