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

  1. #MAX_QUOTES 250
  2. #OUTPUT_FILE 'FOSBACK.TXT'
  3. {
  4.   ---------------------   FOSBECK TREND INDICATORS -------------------------
  5. Written: 9/13/91 by Judith Lipmanson
  6.  
  7. Calculates 3 Fosbeck trend stages, and codes Buy/Sell signals. Reference:
  8. Stock Market Logic. Norman Fosbeck. 1986:Institute for Economic Research.
  9. New buys and sells are starred. "Old" sells that have not improved are
  10. coded with an "S", and "old" buys are coded with "H" for hold. The 10-day
  11. RSI is shown for reference only.
  12. }
  13. good_date = date;
  14. alert := ' ';
  15. comment := '            ';
  16. lt = ' ';
  17. it := ' ';
  18. st := ' ';
  19. yst := ' ';
  20. rsi10 : array;
  21. rsi_limit := 50;
  22. if good_date = date then
  23. BB1 : ARRAY; {Building block #1 of all 3 calculations }
  24. BB2 : array; {building block #2. What Fosback calls Strength Rating.}
  25. LT_CALC : ARRAY; {Long-term indicator}
  26. IT_CALC : ARRAY; {Intermediate-term indicator}
  27. ST_CALC : ARRAY; {Short-term calculation}
  28. { start computing Fosbacks }
  29. BB1 := mov(c,150,'s');
  30. BB2 := roc(c,65,'%');
  31. LT_CALC := roc(bb1,5,'$');
  32. IT_CALC := roc(bb2,5,'$');
  33. ST_CALC := sub(mulby(subfrom(div(c,bb1),1),100),bb2);
  34. rsi10 := rsi(10);
  35. {code results}
  36.     IF LT_CALC > 0 THEN
  37.        LT = '+'
  38.     ELSE
  39.        LT = '-';
  40.     IF IT_CALC > 0 THEN
  41.        IT = '+'
  42.     ELSE
  43.        IT = '-';
  44.     IF ST_CALC > 0 THEN
  45.        ST = '+'
  46.     ELSE
  47.        ST = '-';
  48.     if st_calc[-1] > 0 then
  49.        yst = '+'
  50.     else
  51.        yst = '-';
  52.     tick_total = tick_total + 1;
  53. if first_ticker then
  54. begin
  55.     writeln(' **************************    TRENDS  ******************    ')
  56. ;
  57.     writeln('  FULLNAME         CLOSE   LT   IT   ST       RSI(10) ');
  58. end;
  59. {show new buy and sell signals}
  60. if lt = '-' and it = '-' and st = '+' and rsi10 >= rsi_limit then
  61. begin
  62.         buy_count = buy_count + 1
  63.         alert = 'B'
  64. end;
  65. if lt = '-' and it = '-' and st = '+' and yst = '-' and alert = 'B' then
  66. begin
  67.         new_buy_count = new_buy_count + 1
  68.         comment = '***NEW BUY'
  69. end;
  70. if lt = '+' and it = '+' and st = '-' then
  71. begin
  72.         sell_count = sell_count + 1
  73.         alert = 'S'
  74. end;
  75. if lt = '+' and it = '+' and st = '-' and yst = '+' and alert = 'S' then
  76. begin
  77.         new_sell_count = new_sell_count + 1
  78.         comment = '***NEW SELL'
  79. end;
  80. if lt = '-' and it = '-' and st = '-' then
  81. begin
  82.         pit_count = pit_count + 1
  83.         comment = 'In the Pits'
  84. end;
  85. if lt = '+' and it = '+' and st = '+' then
  86. begin
  87.         top_count = top_count + 1
  88.         comment = 'Strong Hold'
  89. end;
  90. begin
  91.  write(FULLNAME,c,'\t',lt,'\t',it,'\t',st,'\t',alert,rsi10,'\t',comment
  92. );
  93.     WRITELN();
  94. end;
  95. if last_ticker then
  96. begin
  97.     writeln('\t\t\n\n************** SUMMARY ********************');
  98.     writeln('\tTickers Processed:              ',INT(tick_total));
  99.     writeln('\tNumber in Buy Stage:            ',int(buy_count));
  100.     writeln('\tNew Buys:                       ',int(new_buy_count));
  101.     writeln('\tNumber in Sell Stage:           ',int(sell_count));
  102.     writeln('\tNew Sells:                      ',int(new_sell_count));
  103.     writeln('\tStrong Holds:                   ',int(top_count));
  104.     writeln('\tWeakest Stage:                  ',int(pit_count));
  105. end;
  106.