home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / BASE40G.TAS < prev    next >
Text File  |  1992-01-04  |  2KB  |  62 lines

  1. {BASE40G.tas}    {Written by Domenic Bianco  Prodigy # CXGV38A
  2. 01/04/92}
  3. {This script compares the current price to the average price
  4. at the 5 day moving average 40 trading days ago.
  5. Output is sorted and printed.}
  6. #OUTPUT_FILE 'LPT1' n
  7. pmov50:array;
  8. PMOV50:=MOV(C,50,'S');
  9. pmov5:array;
  10. pmov5:=mov(c,5,'s');
  11. hi:=hhv(h,200);
  12. lo:=llv(l,30);
  13. vmov50:array;
  14. vmov50:=MOV(V,50,'S');
  15. P30:=pmov5[-40];
  16. CHG:=(c-p30)/c*100
  17. chg50=(c-pmov50)/c*100
  18. chghi=(c-hi)/c*100
  19. chgv=(v-vmov50)/vmov50*100
  20. if c>.851*hi and c>=.98*pmov50 and C>.951*Pmov50 and C<=1.051*Pmov50
  21. begin
  22. sortout(hi,lo,Ticker,C[0],PMOV50,P30,V[0],VMOV50,chgv,chg50,chghi);
  23. pgraph='y' {change to something else to turn off graph}
  24.   if pgraph='y'
  25.   begin
  26.   opengraph(3);
  27.   sizegraph(4,3,1);
  28.   graph(1,'PRICE',mov(c,50,'s'),'50Day MA',mov(c,200,'s'),'200DayMA',
  29.          mov(c,5,'s'),'5 Day MA');
  30.   graph(1,'PRICE',
  31.          bbandt(20,2),'BBand Top',
  32.          bbandb(20,2),'BBand Bottom');
  33.   graph(v,'VOLUME',vmov50,'50day MA');
  34.   closegraph();
  35.   end
  36. end
  37. IF last_ticker
  38. begin
  39. {writeln('          1          2         3         4         5
  40.     6');
  41. writeln('01234567890112345678901234567890123456789012345678901234567890');}
  42. writeln('  A      B      C     D     E     F      G   H    I  J K');
  43. Writeln('----------------------------------------------------------');
  44. writeln('<             P   R   I   C   E      > < Volume    > Dvs ');
  45. writeln(' High   Low Symbol  Recent Avg50 Avg40 RcntAvg50 Pct E A');
  46. writeln('====== ==== ======  ====== ===== ===== ========= ========');
  47. sorton(10,'a')
  48. sortget(V1,V2,V3,V4,V5,V6,v7,v8,v9,v10,v11);
  49. str1='%5.2f %5.2f %s %5.2f %5.2f %5.2f %4.0f %4.0f %3.0f %1.0f';
  50. str2=str1 + '%4.0f\n';
  51. sortprint(str2);
  52. writeln('  ');
  53. writeln('C is most recent recorded closing price');
  54. writeln('High - last 200, Low - last 30 trading days');
  55. writeln('Avg40 is the 5 day mov avg at the close 40 trading days ago')
  56. writeln('Avg50 is the moving average of price and volume');
  57. writeln('Col I J and K are % values');
  58. writeln('Price is filtered on  c>=50 day moving average)');
  59. writeln('and  [1.05*Avg40] < C > [.95*Avg40] and c>[.85*High]');
  60. writeln('    \p');
  61. END
  62.