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

  1. {***************** B_S_LINE.TAS  08/10/92 **********************}
  2. { This subroutine will draw vertical buy sell lines on the graph }
  3. { just plotted. This sub is called by GOSUB B_S_LINE immediately }
  4. { after GRAPH(.....) call}
  5. {******************* IMPORTANT FOR USE OF THIS SUB ***************}
  6. {IMPORTANT...This sub NEEDS AS INPUT a position array called POS }
  7. { YOU need set up this position array is 1 when you are long and}
  8. {  -1 when short as input to this sub}
  9. {***************** IMPORTANT END ********************************}
  10. { ******** Written by DENNIS MEYERS *********}
  11. :b_s_line
  12. {if lsw=0 got next}   {****** if buy sell line switch <>0 then draw b/s line
  13. s}
  14. x_pos : array;
  15.   n_arrows=0;
  16.   for i=2; i<=qe; i=i+1; begin
  17.     if pos[i] <> pos[i-1] then begin
  18.       n_arrows=n_arrows + 1;
  19.       x_pos[n_arrows]=i;
  20.       {writeln( int(n_arrows), ' arrow position=',int(x_pos[n_arrows]),
  21.              ' arrow=',int(pos[i]));}
  22.     end; {arrow x position}
  23. end; {for loop}
  24.   if n_arrows=0  goto next;
  25.   xmax=c[1];
  26.   xmin=c[1];
  27.   for i=2; i<=qe; i=i+1; begin
  28.     if c[i]>xmax xmax=c[i];
  29.     if c[i]<xmin xmin=c[i];
  30.   end;{xmax,xmin for loop}
  31.   for i=1; i<=n_arrows; i=i+1; begin
  32.     k=x_pos[i];
  33.     color=2;
  34.     if pos[k]=-1 then color=4;
  35.     drawline(color,k-0.05,xmin,k+0.05,xmax,k-0.5,k+0.5);
  36.   end; {for loop}
  37. :next
  38. return;
  39.