home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
finance
/
tas515dm.zip
/
EXAMPLES.ZIP
/
KST1.TAS
< prev
next >
Wrap
Text File
|
1992-12-20
|
3KB
|
133 lines
{Martin below is KST script we've talked about. I think you or your }
{customers may find it interesting. David S. Landry, *P* MMMJ96A }
{ This script displays three KST indicators: the short, immed., and long }
{ The "Know Sure Thing" was developed by Martin Pring. It takes 4 rate }
{ of changes smoothes and weights them for the time period then sums them }
{ up. You can change the values of R1..R4 to get different time periods. }
{ Buy when the KST rises above the trigger and sell when it falls below. }
{ Use the three time periods to help you make your decision. Also, strong}
{ buy signals are given when the KST falls below zero then rises above }
{ zero.}
{Below is a "beta" version......I feel it can still use further }
{documentation and improvements...it requires TAS 4.08 w/ Graph feature }
{Modified 20 Dec 92 to calculate each KST individualy also included a
simple long term screen. Lew Hall 307-674-9585}
#MAX_QUOTES 200
{}
{ Define arrays to be used: }
kst : ARRAY;
kst1 : array;
kst2 : array;
kst3 : array;
roc1 : array;
roc2 : array;
roc3 : array;
roc4 : array;
maroc1 : array;
maroc2 : array;
maroc3 : array;
maroc4 : array;
temp1 : array;
temp2 : array;
{Values for a short term KST:}
r1 = 3;
r2 = 4;
r3 = 6;
r4 = 10;
gosub calckst1;
kst1 = kst;
{Values for a immed. KST:}
r1= 10;
r2= 13;
r3= 15;
r4 = 20;
gosub calckst2;
kst2 = kst;
{Values for a long term KST:}
r1 = 39;
r2 = 52;
r3 = 78;
r4 = 104;
gosub calckst3;
kst3= kst;
gosub screenit;
{gosub graphit;}
end;
:calckst1
if QUOTE_COUNT > 170 THEN
BEGIN
{calculate ROC }
roc1=ROC(c,r1,'%');
roc2=ROC(C,r2,'%');
roc3=ROC(C,r3,'%');
roc4=ROC(C,r4,'%');
{calculate MA on each array}
maroc1=mov(roc1,3,'e');
maroc2=mov(roc2,4,'e');
maroc3=mov(roc3,6,'e');
maroc4=mov(roc4,8,'e');
{weight each array}
mulby(maroc1,1); {redundant statement, used for clarity}
mulby(maroc2,2);
mulby(maroc3,3);
mulby(maroc4,4);
{sum up all the arrays}
temp1 = ADD(maroc1,maroc2);
temp2 = add(maroc3,maroc4);
kst = add(temp1,temp2);
end;
return;
:calckst2
roc1=ROC(C,r1,'%');
roc2=ROC(C,r2,'%');
roc3=ROC(C,r3,'%');
maroc1=mov(roc1,10,'e');
maroc2=mov(roc2,13,'e');
maroc3=mov(roc3,15,'e');
maroc4=mov(roc4,20,'e');
mulby(maroc1,1);
mulby(maroc2,2);
mulby(maroc3,3);
mulby(maroc4,4);
temp1 = ADD(maroc1,maroc2);
temp2 = ADD(maroc3,maroc4);
kst = ADD(temp1,temp2);
end;
return;
:calckst3
roc1=ROC(C,r1,'%');
roc2=ROC(C,r2,'%');
roc3=ROC(C,r3,'%');
roc4=ROC(C,r4,'%');
maroc1=mov(roc1,26,'e');
maroc2=mov(roc2,26,'e');
maroc3=mov(roc3,26,'e');
maroc4=mov(roc4,39,'e');
mulby(maroc1,1);
mulby(maroc2,2);
mulby(maroc3,3);
mulby(maroc4,4);
temp1 = ADD(maroc1,maroc2);
temp2 = ADD(maroc3,maroc4);
kst = ADD(temp1,temp2);
end;
return;
:screenit
if kst3 < 0 and
kst3 >= mov(kst3,26,'e') and kst3[-2] < mov(kst3,26,'e')
goto graphit;
else
return;
:graphit
{Graph the three KSTs and display a 10 day MA "trigger"}
{You may want to experiment with the trigger on the individual}
{KSTs}
OPENGRAPH(4);
sizegraph(1,1,1,2);
graph(kst1,'Short KST',mov(kst1,8,'e'),'8day MA');
graph(kst2,'Immed KST',mov(kst2,10,'e'),'10day MA');
graph(kst3,'Long KST',mov(kst3,26,'e'),'26day MA');
graph(1);
closegraph();
return;