home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
finance
/
tas515dm.zip
/
EXAMPLES.ZIP
/
THRUST.TAS
< prev
next >
Wrap
Text File
|
1993-03-11
|
6KB
|
145 lines
{ THRUST.TAS
Modified Market.tas for the Thrust Index - TASC March 1993 Page 58
Modified By Steve Hedlund - 818-368-2897
This script generates a market 'snapshot'. It will
calculate
-the McClellan Oscillator and the McClellan Summation
indicators.
-the Thrust Index.
-the Elphick's Volume Oscillator
Calculate a McClellan Oscillator as follows
ADdiff = NYAD - NYDE;
MacOsc = MOV(ADdiff,19,'E')-MOV(ADdiff,39,'E')
Calculate EVO as
CVI = cumulative sum of (up vol-down vol)/total vol
EVO = (3 day EMA of CVI - 10 day EMA of CVI) * 100
Calculate Thrust Index Short Term Trading Index as
TRIN = ((ADV ISSUES*ADV VOLUME)-(DEC ISSUES*DEC VOLUME))
------------------------
((ADV ISSUES*ADV VOLUME)+(DEC ISSUES*DEC VOLUME))
-----------------------------------------------------
To run this, you should have a ticker file containing
one of the following tickers and modify the variables
named below to be the names of the tickers containing
your advancing/declining issues, NYSE up/dn vol and
NYSE total volume.
It is important to note that ALL of the ticker files
must have the _SAME_ number of quotes, or you should
set #MAX_QUOTES to the _minimum_ number of quotes in
any of the ticker files used for indices.
NYADname - Advancing
NYDEname - and NYSE Declining issues
SPNUname - NYSE Up Volume
SPNDname - NYSE Down Volume
NYSEname - Composite
-----------------------------------------------------
}
MacSumBase = 569; { Set this to whatever starting value
you want to MacSum to start at}
CVIBase = 0; { and to adjust for the keeper of the EVO}
#index 'SPX'
#output_file 'market.lst'
#MAX_QUOTES 200
{
NOTE----------------------------------------------
Change the 5 symbol names in quotes below to
whatever symbols you use for the tickers shown
NOTE----------------------------------------------
}
NYADname = 'NYAD'; { Change to your NYSE Adv Issues ticker}
NYDEname = 'NYDE'; { Change to your NYSE Dec Issues ticker}
NYUPname = 'SPNU'; { Change to your NYSE UP Vol ticker}
NYDNname = 'SPND'; { Change to your NYSE DN Vol ticker}
NVOLname = 'NYSE'; { Change to your NYSE Total Volume}
GRAPH_IT = 1; { Set to 1 to see graphs}
NYAD : ARRAY; { advancing issues}
NYDE : ARRAY; { declining issues}
NYUP : ARRAY; { Up Vol}
NYDN : ARRAY; { Dn Vol}
NVOL : ARRAY; { Total Vol}
NYSE : ARRAY; { NYSE Comp}
VLdiff : ARRAY; { Up - Dn}
CVI : ARRAY; { Cum Vol Index}
EVO : ARRAY; { EVO goes here}
ADdiff : ARRAY; { advancing - declining}
MacOsc : ARRAY; { McClellan Oscillator goes here}
MacSum : ARRAY; { McClellan Summation goes here}
MacBaseArray : ARRAY; { array of Base value}
CVIBaseArray : ARRAY; { Mike Elphick's values}
TRIN : ARRAY; { Thrust Index }
TRIN1 : array; { Temp Arrays for Thrust Index }
TRIN2 : array;
TRIN3 : array;
TRIN4 : array;
TRIN10 : array; { 10 Day MA of Thrust}
TRIN21 : array; { 21 Day MA of Thrust }
NYAD = LOAD(NYADNAME,'C');
NYDE = LOAD(NYDENAME,'C');
NYUP = LOAD(NYUPNAME,'C');
NYDN = LOAD(NYDNNAME,'C');
NVOL = LOAD(NVOLname,'V');
NYSE = LOAD(NVOLname,'C');
{----------COMPUTATION HERE --------------}
if last_ticker = 0 then return;
{----- McClellan calculation-----}
ADdiff = SUB(NYAD,NYDE); { Adv - Dec}
MacOsc = SUB(MOV(ADdiff,19,'E'),MOV(ADdiff,39,'E')); {19ema-39ema}
SET(MacBaseArray,MacSumBase); { set array to constant value}
MacSum = CUM(MacOsc); { compute cumulative value}
MacSum = ADD(MacSum,MacBaseArray); { add the base offset for macsum}
{----- EVO calculation-----}
VLdiff = DIV(SUB(NYUP,NYDN),NVOL); { (UP - DN)/TOTAL}
CVI = CUM(VLdiff);
SET(CVIBaseArray,CVIBase); { set array to constant value}
CVI = ADD(CVI,CVIBaseArray);
EVO = SUB(MOV(CVI,3,'E'),MOV(CVI,10,'E')); {10ema-3ema}
EVO = MULBY(EVO,100); { EVO * 100}
{-----Thrust calculation-----}
TRIN1:= MUL(NYAD,NYUP);
TRIN2:= MUL(NYde,NYDN);
TRIN3:= SUB(TRIN1,TRIN2);
TRIN4:= ADD(TRIN1,TRIN2);
TRIN := DIV(TRIN3,TRIN4);
TRIN10 := MOV(TRIN,10,'S');
TRIN21 := MOV(TRIN,21,'s');
{ now that all the values are calculated,
write them out}
WRITELN(
' TAS Market Summary for ',DATE);
WRITELN();
WRITELN(
' Today Yesterday',
' Change');
WRITELN('McClellan Oscillator ',MacOsc,' ',MacOsc[-1],
' ',MacOsc-MacOsc[-1]);
WRITELN('McClellan Summation ',MacSum,' ',MacSum[-1],
' ',MacSum-MacSum[-1]);
WRITELN('Elphicks Volume Oscillator(EVO) ',EVO, ' ',EVO[-1],
' ',EVO-EVO[-1]);
WRITELN('Cumulative Volume Index(CVI) ',CVI, ' ',CVI[-1],
' ',CVI-CVI[-1]);
WRITELN('Thrust Index ',TRIN,' ',TRIN[-1],
' ',TRIN-TRIN[-1]);
wRITELN('Thrust Index - 10 Day MA ',TRIN10,' ',TRIN10[-1],
' ',TRIN10-TRIN10[-1]);
WRITELN('Thrust Index - 21 Day MA ',trin21,' ',trin21[-1],
' ',trin21-trin21[-1]);
if graph_it=0 then return;
OPENGRAPH(3); { Start 3 graphs}
GRAPH(nyse,'NYSE Composite');
GRAPH(MacOsc,'McClellan Oscillator');
GRAPH(MacSum,'McClellan Summation');
CLOSEGRAPH();
{At this point, the EVO and CVI are computed and held in arrays
EVO and CVI. Let's graph them under NYSE Composite}
OPENGRAPH(3); { Start 3 graphs}
GRAPH(NYSE,'NYSE Composite');
GRAPH(CVI,'Cumulative Volume Index');
GRAPH(EVO,'Elphicks Volume Oscillator');
CLOSEGRAPH();
OPENGRAPH(3);
GRAPH(nyse,'NYSE Composite');
GRAPH(TRIN,'Thrust Index',trin10,'10 Day MA Thrust');
GRAPH(trin21,'21 Day MA Thrust');
CLOSEGRAPH();