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

  1. { CCIOPT.TAS
  2.     Script that shows how to do Profit Test for multiple periods of
  3.     an indicator to see which one generates the best profits. 
  4.     You should run this script as follows:
  5.         TAS CCIOPT ticker @Speriod=s; Eperiod=e;
  6.     where "ticker" is the ticker list to run (make it a small one!)
  7.         "s" is the starting period for the CCI optimization test
  8.         "e" is the ending period for the CCI optimization test
  9. }
  10. #MAX_QUOTES 1000
  11. #PROFIT_TEST  BOTH 1000 Y
  12. #PROFIT_COMM  NOCOMM ALLCASH 0 - TODAYS CLOSE
  13. #PROFIT_OUTPUT  TICKERSUMMARY
  14. #OUTPUT_FILE  'CCIOPT.LST+'
  15. {
  16.     Check if the Start period and End period were specified when
  17.     the script began. If not, then default to 1 to 500.
  18. }
  19. If Speriod = 0 then
  20.     Speriod = 1;        { Start at 1 day period}
  21. if Eperiod = 0 then
  22.     Eperiod = 500;        { go to 500 day period }
  23. F1 : ARRAY;
  24. PLOT BEGIN
  25.         Period = REDO_COUNT()+Speriod;
  26.         writeln('CCI Period IS ',INT(Period));
  27.         F1 = CCI(Period);
  28.         IF Period < Eperiod THEN
  29.                 REDO();
  30. END; { of PLOT BEGIN}
  31. C1 = (F1[-1] < -100 AND F1[0] > -100);
  32. C2 = (F1[-1] > 100 AND F1[0] < 100);
  33. BUY WHEN (C1);
  34. SELL WHEN (C2);
  35.