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

  1. { Written by Jim Camenos, May 29, 1991, Prodigy code VNGH10A  looks at current trading range over past 50 days + volume for break-outs..* Modified 2/28/92 by Tom Rategan. Graphs price and volume. Price graph  tells close, high, % off high, avg daily hi-lo range, today's hi-lo range,  change today, and 30 day trading range. Volume graph shows today's  volume, avg volume (50MA), % today vs 50MA; 5MA, and % 5MA vs 50MA.  Comparing the 5MA to the 50MA tries to show how the recent volume trend  compares with the longer average. Data is displayed on the screen during  scanning. Jim's original Trading.tas script looked for greater than 2  times average volume, I loosened that to 1.5 times average volume..* Modified 3/4/92 by Jim Camenos.  Addition to Tom's fine work, I added a  Buy / Sell Oscillator.  --  Over 0 one might consider to be long the stock, under 0  one might consider to be flat.  The Oscillator is made up of a 3/35 cross-  over and the moving average on the price chart is a 35da sma.}#max_quotes 265#OUTPUT_FILE 'TRADING.LST'if QUOTE_COUNT < 51 then RETURN;  { Skip short stocks MM 6/5}c35 : array;c35 = mov(c,35,'s');c5 : array;c5 = mov(c,5,'s');ct : array;ct = sub(c5,c35);tx: array;tx=TR();gosub true_range;if first_ticker then beginwriteln('Hi-Lo range today > 2X average & Volume today > 1.5 times average.');writeln('    Name          Close   Change   AvgRg   Today   %OH  %30Rg   Vol     %V');writeln('    ----          -----   ------   -----   -----   ---  -----   ---     --'); end;if int(tr_sum)<>0 then goto wrtgrph else return;:wrtgrphwriteln(fullname,c[0],chg,avg_tr,tx[0],int(oh),'%',int(r30),'% ',v[0],int(v_v50),'%');opengraph(3);sizegraph(6,2,2);graph(1,'  '+format(c[0],'$%5.2f')+' is '+format(oh,'%4.2f%')+' off '+format(hivalqc[0],'$%5.2f')+' high. Change= '+format(chg,'$%2.2f')+'. AvgRg= '+format(avg_tr,'$%1.2f')+', Today= '+format(tx[0],'$%2.2f')+'. 30 Day Range= '+format(r30,'%2.2f%'),c35);graph(ct,'Buy / Sell Oscillator ** OVER = Long / UNDER = Short')graph(v,'Today='+format(v[0],'%5.f')+'    50MA='+format(v50[0],'%5.f')+'    %Today='+format(v_v50,'%4.f%')+'    5MA='+format(v5,'%5.f')+','+format(v5_v50,'%4.f%')+' of',v50,'50MA');closegraph();return;:true_rangeavg_tr = sum(tx,50)/50;if tx[0] >= avg_tr*2 then goto chkvol else tr_sum = 0;return;:chkvolv50 : array;v50 = mov(v,50,'s'); if v[0] >= v50[0]*1.5 then goto stats else tr_sum = 0;return;:statstr_sum = 1;hivalqc : array;hi30 : array;lo30 : array;qc=(quote_count - 2);hi30 = hhv(c,30);lo30 = llv(c,30);hivalqc = hhv(c,qc);r30 = (1-(lo30/hi30))*100;oh = 100-((c/hivalqc)*100);v5 = sum(v,5)/5;v_v50 = ((v[0]/v50[0])*100);v5_v50 = ((v5/v50[0])*100);chg = c[0] - c[-1];return;
  2.