home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / MASSINDX.ZIP / MASSIND2.TAS < prev   
Text File  |  1992-06-03  |  2KB  |  53 lines

  1. { Mass Index.TAS
  2.   Compute the Mass Index Stocks and Commodities June 1992.
  3.   Article written by Donald Dorsey.
  4.   Program written by Sam Kerr (Prodigy-SXBX09A)
  5. }
  6. #PROFIT_TEST  BOTH    1000   N
  7. #PROFIT_COMM  NOCOMM ALLCASH    0 - TODAYS CLOSE
  8. #PROFIT_OUTPUT  TICKERSUMMARY
  9. #OUTPUT_FILE  'massind2.LST'
  10. #MAX_QUOTES 500
  11. RNGE_DAILY : ARRAY;
  12. SMOOTH_DAILY : ARRAY;
  13. SMOOTH_SMOOTH : ARRAY;
  14. SMOOTH_DIVISOR : ARRAY;
  15. SUM_SMOOTH : ARRAY;
  16. ma1 : ARRAY;
  17. ma2 : ARRAY;
  18. VO1 : ARRAY;   { I have these in here to do some testing with volume }
  19. VO2 : ARRAY;
  20. if quote_count < 50 THEN return;
  21. plot begin
  22.  RNGE_DAILY = SUB(h,l);
  23.  SMOOTH_DAILY = MOV(RNGE_DAILY,25,'E');
  24.  SMOOTH_SMOOTH = MOV(SMOOTH_DAILY,25,'E');
  25.  SMOOTH_DIVISOR = DIV(SMOOTH_DAILY,SMOOTH_SMOOTH);
  26.  SUM_SMOOTH = SUM(SMOOTH_DIVISOR,25);
  27.  ma1 = MOV(c,25,'E');
  28.  ma2 = MOV(ma1,25,'E');
  29.  VO1 = MOV(V,25,'E');
  30.  VO2 = MOV(VO1,25,'E');
  31. end;
  32. {  use the line below to audit results }
  33. {writeln(dates,sum_smooth,smooth_daily,smooth_smooth,smooth_divisor,
  34.  ma1,ma2,c,v);}
  35. IF PT_PRICE('L') = 0 and PT_PRICE('S') >999999.0 THEN
  36. BEGIN
  37.  DYS_CNT = 0; { Reset counter if no position currently }
  38. END;
  39. IF PT_PRICE('L') > 0 OR PT_PRICE('S') < 999999.0 THEN
  40. BEGIN
  41.  DYS_CNT = DYS_CNT + 1; { Add one to counter if long or short }
  42. END;
  43. BUY WHEN sum_smooth < 26.5 and (sum_smooth[-1] >= 27 or
  44. sum_smooth[-2] >= 27 or sum_smooth[-3] >= 27 or sum_smooth[-4] >= 27 or
  45. sum_smooth[-5] >= 27 or sum_smooth[-6] >= 27 or sum_smooth[-7] >= 27)
  46. and ma1 < ma2;
  47. sell WHEN sum_smooth < 26.5 and (sum_smooth[-1] >= 27 or
  48. sum_smooth[-2] >= 27 or sum_smooth[-3] >= 27 or sum_smooth[-4] >= 27 or
  49. sum_smooth[-5] >= 27 or sum_smooth[-6] >= 27 or sum_smooth[-7] >= 27)
  50. and ma1 > ma2;
  51. STOP LONG WHEN DYS_CNT = 15;    { This is number of days article said }
  52. STOP short WHEN DYS_CNT = 15;   { before you close out position }
  53.