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

  1. { Written by Jim Camenos, May 29, 1991, Prodigy code VNGH10A
  2.   looks at current trading range over past 50 days + volume for break-outs
  3. .
  4. .
  5. * Modified 2/28/92 by Tom Rategan. Graphs price and volume. Price graph
  6.   tells close, high, % off high, avg daily hi-lo range, today's hi-lo range,
  7.   change today, and 30 day trading range. Volume graph shows today's
  8.   volume, avg volume (50MA), % today vs 50MA; prior 7MA, and prior 7MA
  9.   vs the 50MA. 7MA does not include today, rather it averages yesterday
  10.   through 8 days ago. Today's volume will always be high, and including
  11.   it in the 7MA would obscure the figure. Showing the prior 7MA tries to
  12.   show how the recent volume compares to the longer average. A large
  13.   high volume price move following a period of low volume and trading
  14.   range is especially significant.
  15.   Jim's original Trading.tas script looked for greater than 2
  16.   times average volume, I loosened that to 1.5 times average volume.
  17. }
  18. #max_quotes 265
  19. {#OUTPUT_FILE 'TRADING.LST'}
  20. if QUOTE_COUNT < 51 then RETURN;  { Skip short stocks MM 6/5}
  21. tx: array;
  22. tx=TR();
  23. gosub true_range;
  24. if first_ticker then
  25.  begin
  26. writeln(
  27. 'Hi-Lo range today > 2X average & Volume today > 1.5 times average.
  28. ');
  29. writeln(
  30. '    Name          Close   Change   AvgRg   Today   %OH  %30Rg   Vol     %V'
  31. );
  32. writeln(
  33. '    ----          -----   ------   -----   -----   ---  -----   ---     --'
  34. );
  35.  end;
  36. if int(tr_sum)<>0 then goto wrtgrph else return;
  37. :wrtgrph
  38. writeln
  39. (fullname,c[0],chg,avg_tr,tx[0],int(oh),'%',int(r30),'% ',v[0],int(v_v50),
  40. '%');
  41. opengraph(2);
  42. sizegraph(4,2);
  43. graph(1,'  '+format(c[0],'$%5.2f')+' is '+format(oh,'%4.2f%')+' off '
  44. +format(hivalqc[0],'$%5.2f')+' high. Change= '+format(chg,'$%2.2f')
  45. +'. AvgRg= '+format(avg_tr,'$%1.2f')+', Today= '+format(tx[0],'$%2.2f')
  46. +'. 30 Day Range= '+format(r30,'%2.2f%'));
  47. graph(v,'Today='+format(v[0],'%5.f')+'    50MA='+format(v50[0],'%5.f')
  48. +'    %Today='+format(v_v50,'%4.f%')+'    Prior 7MA='+format(v7,'%5.f')
  49. +','+format(v7_v50,'%4.f%')+' of',v50,'50MA');
  50. closegraph();
  51. return;
  52. :true_range
  53. avg_tr = sum(tx,50)/50;
  54. if tx[0] >= avg_tr*2 then goto chkvol else tr_sum = 0;
  55. return;
  56. :chkvol
  57. v50 : array;
  58. v50 = mov(v,50,'s');
  59.  if v[0] >= v50[0]*1.5 then goto stats else tr_sum = 0;
  60. return;
  61. :stats
  62. tr_sum = 1;
  63. hivalqc : array;
  64. hi30 : array;
  65. lo30 : array;
  66. qc=(quote_count - 2);
  67. hi30 = hhv(c,30);
  68. lo30 = llv(c,30);
  69. hivalqc = hhv(c,qc);
  70. r30 = (1-(lo30/hi30))*100;
  71. oh = 100-((c/hivalqc)*100);
  72. v7 = ((v[-1]+v[-2]+v[-3]+v[-4]+v[-5]+v[-6]+v[-7])/7)
  73. v_v50 = ((v[0]/v50[0])*100);
  74. v7_v50 = ((v7/v50[0])*100);
  75. chg = c[0] - c[-1];
  76. return;
  77.