home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
finance
/
tas515dm.zip
/
EXAMPLES.ZIP
/
MASSINDX.ZIP
/
MASSIND2.TAS
< prev
Wrap
Text File
|
1992-06-03
|
2KB
|
53 lines
{ Mass Index.TAS
Compute the Mass Index Stocks and Commodities June 1992.
Article written by Donald Dorsey.
Program written by Sam Kerr (Prodigy-SXBX09A)
}
#PROFIT_TEST BOTH 1000 N
#PROFIT_COMM NOCOMM ALLCASH 0 - TODAYS CLOSE
#PROFIT_OUTPUT TICKERSUMMARY
#OUTPUT_FILE 'massind2.LST'
#MAX_QUOTES 500
RNGE_DAILY : ARRAY;
SMOOTH_DAILY : ARRAY;
SMOOTH_SMOOTH : ARRAY;
SMOOTH_DIVISOR : ARRAY;
SUM_SMOOTH : ARRAY;
ma1 : ARRAY;
ma2 : ARRAY;
VO1 : ARRAY; { I have these in here to do some testing with volume }
VO2 : ARRAY;
if quote_count < 50 THEN return;
plot begin
RNGE_DAILY = SUB(h,l);
SMOOTH_DAILY = MOV(RNGE_DAILY,25,'E');
SMOOTH_SMOOTH = MOV(SMOOTH_DAILY,25,'E');
SMOOTH_DIVISOR = DIV(SMOOTH_DAILY,SMOOTH_SMOOTH);
SUM_SMOOTH = SUM(SMOOTH_DIVISOR,25);
ma1 = MOV(c,25,'E');
ma2 = MOV(ma1,25,'E');
VO1 = MOV(V,25,'E');
VO2 = MOV(VO1,25,'E');
end;
{ use the line below to audit results }
{writeln(dates,sum_smooth,smooth_daily,smooth_smooth,smooth_divisor,
ma1,ma2,c,v);}
IF PT_PRICE('L') = 0 and PT_PRICE('S') >999999.0 THEN
BEGIN
DYS_CNT = 0; { Reset counter if no position currently }
END;
IF PT_PRICE('L') > 0 OR PT_PRICE('S') < 999999.0 THEN
BEGIN
DYS_CNT = DYS_CNT + 1; { Add one to counter if long or short }
END;
BUY WHEN sum_smooth < 26.5 and (sum_smooth[-1] >= 27 or
sum_smooth[-2] >= 27 or sum_smooth[-3] >= 27 or sum_smooth[-4] >= 27 or
sum_smooth[-5] >= 27 or sum_smooth[-6] >= 27 or sum_smooth[-7] >= 27)
and ma1 < ma2;
sell WHEN sum_smooth < 26.5 and (sum_smooth[-1] >= 27 or
sum_smooth[-2] >= 27 or sum_smooth[-3] >= 27 or sum_smooth[-4] >= 27 or
sum_smooth[-5] >= 27 or sum_smooth[-6] >= 27 or sum_smooth[-7] >= 27)
and ma1 > ma2;
STOP LONG WHEN DYS_CNT = 15; { This is number of days article said }
STOP short WHEN DYS_CNT = 15; { before you close out position }