home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / finance / tas206.zip / LIMIT.TAS < prev    next >
Text File  |  1991-02-17  |  881b  |  36 lines

  1. { limit.tas
  2.         This is an example of using a TAS script to watch your
  3.         stocks. 
  4.         
  5.         It checks the ticker symbol against one of several
  6.         which you might (and I do) own. If the current close
  7.         (shown as 'c[0]' is greater than the limit for profit
  8.         or less than the stop loss, a message is generated.
  9. }
  10.  
  11. stop_loss := 0;
  12. sell_profit := 0;
  13. if ticker = 'aapl' then
  14.     if c > 47 then 
  15.         sell_profit := 1;
  16.     else
  17.     if c < 41 then
  18.         stop_loss := 1;
  19. if ticker = 'gr' then
  20.     if c > 43 then 
  21.         sell_profit := 1;
  22.     else
  23.     if c < 38 then
  24.         stop_loss := 1;
  25. if ticker = 'la' then
  26.     if c > 27 then 
  27.         sell_profit := 1;
  28.     else
  29.     if c < 10 then
  30.         stop_loss := 1;
  31.  
  32. if stop_loss = 1 then
  33.     writeln(ticker, ' has reached your STOP LOSS limit. SELL');
  34. if sell_profit = 1 then
  35.     writeln(ticker, ' has reached your Profit target. SELL');
  36.