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

  1. TRADRNGZ.TAS
  2.  ---------------------------------------------------------------------
  3.  { Written by Jim Camenos, May 29, 1991,
  4.  Prodigy code VNGH10A  looks at current trading
  5.  range over past 50 days + volume for break-outs..
  6.  Graphs price and volume. Price graph tells close,
  7.  high, % off high, avg daily hi-lo range, today's
  8.  hi-lo range,  change today, and 30 day trading
  9.  range. Volume graph shows today's  volume, avg
  10.  volume (50MA), % today vs 50MA; 5MA, and % 5MA
  11.  vs 50MA.  Comparing the 5MA to the 50MA tries to
  12.  show how the recent volume trend  compares with the
  13.  longer average. Data is displayed on the screen
  14.  during  scanning.
  15.  Jim's original Trading.tas script looked for greater
  16.  than 2  times average volume, I loosened that to 1.5
  17.  times average volume..
  18.   Addition to Tom's fine work, I added a  Buy / Sell
  19.  Oscillator.
  20.   --  Over 0 one might consider to be
  21.  long the stock, under 0  one might consider to be
  22.  flat.  The Oscillator is made up of a 3/35 cross-
  23.  over and the moving average on the price chart is a
  24.  35da sma.}
  25.  #max_quotes 265
  26.  #OUTPUT_FILE 'TRADING.LST'
  27.  {#SCAN_DATE 920214}
  28.  if QUOTE_COUNT < 51 then RETURN;  { Skip short stocks MM 6/5}
  29.  c35 : array;
  30.  c5 : array;
  31.  ct : array;
  32.  tx: array;
  33.  c35 = mov(c,35,'s');
  34.  c5 = mov(c,5,'s');
  35.  ct = sub(c5,c35);
  36.  tx=TR();
  37.  gosub true_range;
  38.  if first_ticker then
  39.  begin
  40.  writeln('Hi-Lo range today > 2X average & Volume today >',
  41.  ' 1.5 times average.');
  42.  writeln('    Name          Close   Change   AvgRg   Today',
  43.  '   %OH  %30Rg   Vol     %V');
  44.  writeln('    ----          -----   ------   -----   -----',
  45.  '   ---  -----   ---     --');
  46.  end;
  47.  goto wrtgrph
  48.  :wrtgrph
  49.  writeln(fullname,c[0],chg,avg_tr,tx[0],int(oh),'%'
  50.  ,int(r30),'% ',v[0],int(v_v50),'%');
  51.  opengraph(3);
  52.  sizegraph(6,2,2);
  53.  graph(1,'  '+format(c[0],'$%5.2f')+' is'
  54.  +format(oh,'%4.2f%')+' off '
  55.  +format(hivalqc[0],'$%5.2f')+' high. Change='
  56.  +format(chg,'$%2.2f')
  57.  +'. AvgRg= '+format(avg_tr,'$%1.2f')
  58.  +', Today= '+format(tx[0],'$%2.2f')
  59.  +'. 30 Day Range= '+format(r30,'%2.2f%'),c35);
  60.  drawline(15,0,hi30[-1],0,hi30[-1],-30,-1);
  61.  drawline(15,0,lo30[-1],0,lo30[-1],-30,-1);
  62.  graph(ct,'Buy / Sell Oscillator ** OVER = Long
  63.  / UNDER = Short');
  64.  graph(v,'Today='+format(v[0],'%5.f')
  65.  +'    50MA='+format(v50[0],'%5.f')+'    %Today='
  66.  +format(v_v50,'%4.f%')+'    5MA='
  67.  +format(v5,'%5.f')+','+format(v5_v50,'%4.f%')
  68.  +' of',v50,'50MA');
  69.  closegraph();
  70.  return;
  71.  :true_range
  72.  avg_tr = sum(tx,50)/50;
  73.  goto chkvol
  74.  return;
  75.  :chkvol
  76.  v50 : array;
  77.  v50 = mov(v,50,'s');
  78.  goto stats
  79.  return;
  80.  :stats
  81.  tr_sum = 1;
  82.  hivalqc : array;
  83.  hi30 : array;
  84.  lo30 : array;
  85.  qc=(quote_count - 2);
  86.  hi30 = hhv(c,30);
  87.  lo30 = llv(c,30);
  88.  hivalqc = hhv(c,qc);
  89.  r30 = (1-(lo30/hi30))*100;
  90.  oh = 100-((c/hivalqc)*100);
  91.  v5 = sum(v,5)/5;
  92.  v_v50 = ((v[0]/v50[0])*100);
  93.  v5_v50 = ((v5/v50[0])*100);
  94.  chg = c[0] - c[-1];
  95.  return;
  96.  
  97.