home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / TRUE.TAS < prev    next >
Text File  |  1991-12-31  |  2KB  |  49 lines

  1. { Written by Jim Camenos, May 31, 1991, Prodigy code VNGH10A
  2.   This program attempts to determine the True Trading Range over the past
  3.   3 months.  It then calculates the standard deviation of the range and
  4.   calculates the number and percentage the True Trading Range occurred
  5.   within 1 standard deviation, 2 standard deviations, 3 standard deviations
  6.   and over.  The higher % in 1 standard deviation, eg, 90%++, indicates
  7.   the underlying equity to be non-volitable.  Higher percentages in 2,3 or
  8.   over 3 standard deviations are more volitable issues.  Stocks trading high
  9.   % in their 1 std deviation will be trading options with lower premium than
  10.   those with lower percentages.  Interesting that AMGN average True Trading
  11.   Range for the past 3 months is $5 and has traded 87% within its 1 std
  12.   deviation and 9% within 2 std deviations.  The std deviation is $3, therefore
  13.   AMGN would have a trading range between $2-$8 daily and 9% or 1 out of every
  14.   11 trading days the range would be in a $12 range.  Check the TAS referance
  15.   manual for the definition of True Trading Range.
  16. }
  17. #max_quotes 67
  18. #OUTPUT_FILE 'TRUE.LST'
  19. tx: array;
  20. tx=TR();
  21. x := quote_count-1;       { load max(66,num of quotes in file) MM 6/5}
  22. avg_tr = sum(tx,x)/x;
  23. sd = std(tx,x);
  24. gosub true_range;
  25. if first_ticker then
  26.  begin
  27.  writeln('Read your charts before making any investment decisions\n\n');
  28.  writeln('                           Trading   1 STD    1 STD()     2     3     3+');
  29.  writeln('                            Range     Dev   Days   0/0   STD   STD   STD');
  30.  end;
  31. writeln(ticker,' ',fullname,avg_tr,' ',sd,int(sd1),' ',int((sd1/x)*100),'%',int((sd2/x)*100),'%',int((sd3/x)*100),'%',int((sd4/x)*100),'%');
  32. return;
  33. :true_range
  34. begin
  35. a = 1;
  36. sd1 = 0;
  37. sd2 = 0;
  38. sd3 = 0;
  39. sd4 = 0;
  40. :true_r
  41. if a > x then return;
  42. if (avg_tr-sd) <= tx[a] and ((avg_tr+sd)>=tx[a]) then sd1 = sd1+1 else
  43. if (avg_tr-(sd*2))<=tx[a] and ((avg_tr+(sd*2))>=tx[a]) then sd2=sd2+1 else
  44. if (avg_tr-(sd*3))<=tx[a] and ((avg_tr+(sd*3))>=tx[a]) then sd3=sd3+1 else
  45.        sd4 = sd4+1;
  46. a = a+1;
  47. goto true_r;
  48. end;
  49.