home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / TRNARND.TAS < prev    next >
Text File  |  1992-03-16  |  3KB  |  67 lines

  1. {TRNARND.TAS => TRNARND.LST  TAS408d}
  2. {*****************************************************************}
  3. {  This script
  4. 1. Looks at a 40 day linear regression and the slope of
  5.    that line to make sure it is negative to find stocks
  6.    that have been moving down.
  7. 2. Compares price to a 40 day moving average to make sure
  8.    the price has just crossed the average.
  9. 3. Compares volume of a 10 day and 40 day exponential average
  10.    to make sure that when the 10 volume is 1.5 times the 40
  11.    day when the price crosses.
  12. written by Jerry Green on a suggestion by Bruce Jackson
  13. 3-15-92}
  14. {*****************************************************************}
  15. #max_quotes 80
  16. #output_file TRNARND.LST
  17. {*****************************************************************}
  18. {                         Write Heading                           }
  19. {*****************************************************************}
  20. if first_ticker then
  21. begin
  22. writeln('Symbol        Name        Price '
  23.         ,' V Dif  Comment');
  24. writeln('------  ---------------- ------- ',
  25.         '-----  -------------------');
  26. end;
  27. {*****************************************************************}
  28. {                        Create Arrays                            }
  29. {*****************************************************************}
  30.      mva_40 : array;
  31.      vol_40 : array;
  32.       vol_5 : array;
  33.      dif_va : array;
  34.      lin_rg : array;
  35.      slop_l : array;
  36. {*****************************************************************}
  37. {                      Caculate Equations                         }
  38. {*****************************************************************}
  39.      mva_40 = mov(c,40,'s');
  40.      vol_40 = mov(v,40,'e');
  41.       vol_5 = mov(v,5,'e');
  42.      dif_va = mulby(div(vol_5,vol_40),100);
  43.      lin_rg = linreg(c,-40,0);
  44.      slop_l = slope(lin_rg);
  45. {*****************************************************************}
  46. {                       Check Conditions                          }
  47. {*****************************************************************}
  48. if c[-1] < mva_40 and
  49.    c > mva_40 and
  50.    slop_l < 0 and
  51.    dif_va > 150
  52.       then
  53. gosub graphit;
  54.       else
  55.    return;
  56. {*****************************************************************}
  57. {                        Graph Ticker                             }
  58. {*****************************************************************}
  59. :graphit
  60. writeln(ticker,fullname,c,int(dif_va),'   Possible Turnaround');
  61. opengraph(3);
  62. sizegraph(4,2,1);
  63. graph(1,''+format(c[0],'$%6.2f'),mva_40);
  64. graph(v,'VOLUME AND 5 AND 50 DAY MA X',vol_5,vol_40);
  65. graph(dif_va,'VOLUME DIFFERENCE');
  66. closegraph();
  67.