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

  1.    {     *** UPDN.TAS *** script by JK Leibovitz P#hnhp08a ***
  2.              (E-mail initial touch up by Martin and room for 
  3.          improvements and inspired by Tom Rategan's hard work
  4.          and unselfishness)
  5.          Calculates Up/Down Volume based on 50 days volume on up
  6.          days divided by volume on down days and tabulates at one
  7.          week back intervals. (Make necessary adjustments for 4 day
  8.          weeks and can be calculated on Thursdays,Fridays or any
  9.          other day). Figures of up/dn individual stocks also on Investor
  10.          Business Daily News charts, but an old indicator
  11.          used by many technicians with various number of days.   }     
  12.  
  13. #MAX_QUOTES 150
  14. #OUTPUT_FILE 'updn.LST'
  15. if quote_count < 150 then return;
  16. If first_ticker then
  17. writeln ( 'Ticker     -8   -7   -6    -5    -4    -3   -2   -1   U/D
  18. ')
  19. ;
  20. VOLP: array;         {volumeplus}
  21. VOLM: array;         {volumeminus}
  22. tvolp: array;        {total v+}
  23. tvolm: array;        {total v-}
  24. DIFR: array;
  25. DIFR=ROC(c,1,'$');
  26. for i = 1; i <= quote_count; i = i+1;
  27. begin
  28. if DIFR[i] > 0 then   
  29. VOLP[i] = V[i];
  30. else
  31. VOLP[i] = 0;
  32. if DIFR[i] < 0 then
  33. VOLM[i] = V[i];
  34. else
  35. VOLM[i] = 0;
  36. end;
  37. tvolp = SUM(VOLP,50);
  38. tvolm = SUM(VOLM,50);
  39. F1=DIV(tvolp,tvolm);       {this is the U/D factor}
  40. F1=P;
  41. UD1: number;
  42. UD2: number;
  43. UD3: number;
  44. UD4: number;
  45. UD5: number;
  46. UD6: number;
  47. UD7: number;
  48. UD8: number;
  49. UD1 = P[-5];
  50. UD2 = P[-10];
  51. UD3 = P[-15];
  52. UD4 = P[-20];
  53. UD5 = P[-25];
  54. UD6 = P[-30];
  55. UD7 = P[-35];
  56. UD8 = P[-40];
  57. end;
  58. { if F1 > 1.7 then }  {if you want to use this filter=optional=open brackets}
  59. begin
  60. sortout (ticker, UD8, UD7, UD6, UD5, UD4, UD3, UD2, UD1, F1);
  61. :printF1
  62. if last_ticker
  63. begin
  64. Sorton (1,'a');
  65. Sortprint('%s  %2.1f  %2.1f  %2.1f  %2.1f  %2.1f  %2.1f  %2.1f  %2.1f  %2.1f
  66. ');
  67. end;
  68.