home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
finance
/
tas515dm.zip
/
EXAMPLES.ZIP
/
DOTDASH.TAS
< prev
next >
Wrap
Text File
|
1992-10-30
|
2KB
|
51 lines
{
Dot-Dash system
The Dot-Dash system is rather simple. For each date in the
price data, a "dot" is indicated
when the current close is higher than the previous close
OR
when the current close is the same as the previous close AND
the previous day had a "dot".
Accumulate the "dots" over a period specified by the caller
for a "Count" period.
Take a simple moving average of the number of "dots" over a
second range called the "Average".
To run this script with the default Count(50) and Average(8), just
type
TAS DOTDASH tickerListName
where tickerListName is the name of the "Ticker List" to run
To run this script with the custom Count and Average, just
type
TAS DOTDASH tickerListName @Count=cc;Average=pp;Dump=d
where
cc is the "Count" over which to sum the "dots"
pp is the "Average" over which to average the count of dots
d is 1 if you want the values 'dumped' to the output file
}
#Output_File DotDash.Lst
If Count = 0 Then
Count = 50; { ** Change this to change default Count **}
If Average = 0 Then
Average = 8; { ** Change this to change default Average **}
Dots is an Array; { An array of "dots" }
ACount is an Array; { An array of Count of "dots" over Count period }
AAverage is an Array; { An SMA of Count over Average period }
Dots = Roc(C,1,'$');
Dots = Div(Dots,Abs(Dots)); { Make the dots +1, -1 or 0 }
For i = 2; i <= Quote_Count; i = i+1;
Begin
if (Dots[i] = -1) then Dots[i] =0.0 { Down Day }
else
if (Dots[i] = 0 and Dots[i-1] = 1) then Dots[i] = 1.0;
End;
ACount = Sum(Dots,Count);
AAverage = Mov(Acount,Average,'S');
OpenGraph(2);
Graph(1,'Close '+Format(C[0],'%8.3f'));
Graph(Acount,Format(Count,'%3.0f Bar Count - '+Format(Acount[0],'%4.0f')),
AAverage,Format(Average,'%3.0f Bar Moving Average - '+
Format(AAverage[0],'%5.2f')));
CloseGraph();
if Dump <> 0 Then
Dump_Array(o,h,l,c,Dots,Acount,AAverage);