home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / 50MAPCT.TAS next >
Text File  |  1991-12-22  |  1KB  |  33 lines

  1. {50mapct.tas}
  2. {This scripts sorts on the closing price being within a specified band
  3.  of the 50 day moving average}
  4. #OUTPUT_FILE 'LPT1'
  5. IF first_ticker
  6. begin
  7. write(' Recent          50 Day Recent :50Day 200Day:  --   Volume ')
  8. ;
  9. writeln('     --');
  10. write(' Change Ticker  Pct Dif  Close :MovAvg Price: Recent  50Mov')
  11. ;
  12. writeln(' PctChg');
  13. end
  14. {Calculate 50 day price average}
  15. PMOV50:=MOV(C,50,'S');
  16. {Calculate Change in Close}
  17. CL:=c[0]-c[-1]
  18. {Calculate 50 day average of Volume,200 day average of price and price and
  19. volume percent change}
  20. VMOV50:=MOV(V,50,'S');
  21. PMOV200:=MOV(C,200,'S');
  22. PPCT:=(c-pmov50)/pmov50*100
  23. VOLP:=(v-vmov50)/vmov50*100
  24. {Change values here to effect sort criteria}
  25. if ppct<2.0 and ppct >-1.5 and PMOV50>0 AND VOLP <25
  26. sortout(CL,TICKER,PPCT,C[0],pmov50,PMOV200,v[0],VMOV50,volp);
  27. if last_ticker
  28. begin
  29. sorton(3,'d')
  30. sortget(v1,v2,v3,v4,v5,v6,v7,v8,V9)
  31. sortprint('%7.2f %s %6.2f %6.2f %6.2f %7.2f %6.0f %6.0f %6.1f\n')
  32. end
  33.