home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / DIVTEST.TAS < prev    next >
Text File  |  1991-04-13  |  5KB  |  189 lines

  1. {
  2.         DIVTEST.TAS     PROC PROFIT TEST SCRIPT EXAMPLE
  3.         This script was written by Frank Wolynski in April 1991.
  4.         It 'encodes' various indicator relationships into a very
  5.         nicely formatted, extremely condense presentation.
  6.  
  7.         To run this script, you must set your SYMBOL TABLE SIZE to
  8.         15000 or so in the TAS CONFIGURATION SCREEN.
  9.  
  10. }
  11. { #SCAN_DATE '910401' }         {Remove brackets & set date for back test}
  12. #MAX_QUOTES 150                 {Increase this # to amount going back}
  13. #OUTPUT_FILE 'DIVTEST.LST'     {Set file name to date for ease }
  14. ob_ar : ARRAY;
  15. ad_ar : ARRAY;
  16. PR100 : ARRAY;
  17. PR26 : ARRAY;
  18. PR12 : ARRAY;
  19. Troc : ARRAY;
  20. if quote_count < 102 then
  21.     return;
  22. PR12 := ROC(C,12,'%');
  23. PR26 := ROC(C,26,'%');
  24. YPR26 := p[-1];
  25. Troc := ADD(PR12,PR26);
  26. PR100 := MOV(ROC(C,12,'%'),100,'S');
  27. m1troc := mov(Troc,10,'S');
  28. ym1troc := p[-1];
  29. m5troc := mov(Troc,50,'S');
  30. d_clo  := c - c[-1];
  31. S_A := STOCH(5,3);
  32. YS_A := p[-1];
  33. SL_A := STOCH(20,5);
  34. YSL_A := p[-1];
  35. avg_vol := cum(V)/quote_count;
  36. ob_ar := obv();                               {obv calcs}
  37. mob_ar := mov(ob_ar,50,'s');                  {MA of obv}
  38. ad_ar := ad();                                {Accum/Dist Calcs}
  39. mad_ar := mov(ad_ar,50,'s');
  40. ma5 := mov(c,50,'s');
  41. ma2 := mov(c,20,'s');
  42. ma1 := mov(c,10,'s');
  43. ma0 := c[0];
  44. if first_ticker then
  45. begin
  46.    writeln('---------------------------------------------------------------------------')
  47.    writeln('Stochastics Studies < 20 Triggers                 P = PRoc Reversal')
  48.    writeln('Script File = DIVTEST1.TAS                        V = Vol > Avg Vol')
  49.    writeln('(+-) = 10maTroc Brk above or below 50maTroc       O = Obv > 50 MA')
  50.    writeln('   - By the Security = (5,3) Reversal             A = Acc/Dist > 50 MA')
  51.    writeln(' * - By the Security = (20,5) Reversal            * = 100MA of 12 PRoc > 0')
  52.    writeln('** - By the Security = Dual Stoch Lows            + = 10maTroc > 50maTroc')
  53.    writeln('---------------------------------------------------------------------------')
  54.    writeln('Security\t\t\tTClose\tChange   Sto  12R  26R  100T 50T   MAPos Flags')
  55.    writeln('---------------------------------------------------------------------------')
  56. end
  57. trigger := 0;
  58. if ((YS_A <= 20 OR S_A <= 20) AND (S_A > YS_A)) then
  59.    begin
  60.     trigger := 1;
  61.     sto := S_A;
  62.    end;
  63. if ((YSL_A <= 20 OR SL_A <= 20) AND (SL_A > YSL_A)) then
  64.    begin
  65.     trigger := 2;
  66.     sto := SL_A;
  67.    end
  68. if (S_A <= 20 AND SL_A <= 20) THEN
  69.    begin
  70.     trigger := 3;
  71.     sto := S_A;
  72.    end
  73. if ((m1troc > m5troc) AND (ym1troc <= m5troc)) then
  74.    begin
  75.     trigger := 4;
  76.     sto := S_A;
  77.    end
  78. if ((m1troc < m5troc) AND (ym1troc >= m5troc)) then
  79.    begin
  80.     trigger := 5;
  81.     sto := S_A;
  82.    end
  83. IF (trigger >= 1 AND trigger <=5) then
  84.  begin
  85.    if trigger = 1 then
  86.       write('  ');
  87.    if trigger = 2 then
  88.       write('* ');
  89.    if trigger = 3 then
  90.       write('**');
  91.    if trigger = 4 then
  92.       write('+ ');
  93.    if trigger = 5 then
  94.       write('- ');
  95.    write(fullname,c,d_clo,INT(sto),' ',INT(PR12[0]),INT(PR26[0]),
  96.          INT(PR100[0]),INT(m5troc),'\t');
  97.    value := 1;
  98.    if (ma5 < ma2 and ma2 < ma1 and ma1 < ma0) then
  99.       begin
  100.       write('5210 ')
  101.       value := 0;
  102.       end
  103.    if (ma5 < ma1 and ma1 < ma2 and ma2 < ma0) then
  104.       begin
  105.       write('5120 ')
  106.       value := 0;
  107.       end
  108.    if (ma5 < ma2 and ma2 < ma0 and ma0 < ma1) then
  109.       begin
  110.       write('5201 ')
  111.       value := 0;
  112.       end
  113.    if (ma5 < ma0 and ma0 < ma2 and ma2 < ma1) then
  114.       begin
  115.       write('5021 ')
  116.       value := 0;
  117.       end
  118.    if (ma5 < ma0 and ma0 < ma1 and ma1 < ma2) then
  119.       begin
  120.       write('5012 ')
  121.       value := 0;
  122.       end
  123.    if (ma5 < ma1 and ma1 < ma0 and ma0 < ma2) then
  124.       begin
  125.       write('5102 ')
  126.       value := 0;
  127.       end
  128.    if (ma0 < ma5 and ma5 < ma1 and ma1 < ma2) then
  129.       begin
  130.       write('0512 ')
  131.       value := 0;
  132.       end
  133.    if (ma0 < ma1 and ma1 < ma5 and ma5 < ma2) then
  134.       begin
  135.       write('0152 ')
  136.       value := 0;
  137.       end
  138.    if (ma2 < ma5 and ma5 < ma1 and ma1 < ma0) then
  139.       begin
  140.       write('2510 ')
  141.       value := 0;
  142.       end
  143.    if (ma2 < ma5 and ma5 < ma0 and ma0 < ma1) then
  144.       begin
  145.       write('2501 ')
  146.       value := 0;
  147.       end
  148.    if (ma2 < ma1 and ma1 < ma5 and ma5 < ma0) then
  149.       begin
  150.       write('2150 ')
  151.       value := 0;
  152.       end
  153.    if (ma2 < ma1 and ma1 < ma0 and ma0 < ma5) then
  154.       begin
  155.       write('2105 ')
  156.       value := 0;
  157.       end
  158.    if (ma1 < ma2 and ma2 < ma0 and ma0 < ma5) then
  159.       begin
  160.       write('1205 ')
  161.       value := 0;
  162.       end
  163.    if (ma1 < ma0 and ma0 < ma2 and ma2 < ma5) then
  164.       begin
  165.       write('1025 ')
  166.       value := 0;
  167.       end
  168.    if (ma0 < ma1 and ma1 < ma2 and ma2 < ma5) then
  169.       begin
  170.       write('0125 ')
  171.       value := 0;
  172.       end
  173.    if value = 1 then
  174.       write('.... ');
  175.    if (PR26 > YPR26) then
  176.        write('P')
  177.    if (v > avg_vol) then
  178.        write('V')
  179.    if (ob_ar > mob_ar) then
  180.        write('O')
  181.    if (ad_ar > mad_ar) then
  182.        write('A')
  183.    if (pr100 > 0) then
  184.        write('*')
  185.    if (m1troc > m5troc) then
  186.        write('+')
  187.    writeln(' ')
  188.  end
  189.