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

  1. {Date:  11-Apr-91 22:19 PDT
  2.  From:  Dan Lucey [73116,3033]
  3.  Subj:  Toombs Stochastic
  4.  
  5. Martin -
  6.  
  7. Certainly.  But you must admit that my programming is certainly UNIQUE!
  8.  
  9. I have added the SAR to that program and it has improved the performance.
  10. If the SAR is below the cost line, it equals 1; if the SAR is above the cost
  11. line, it equals -1.
  12.  
  13. Buy is now  Toombs = 2 and SAR = 1.
  14.  
  15. Sell is now Toombs = -1 and SAR = -1.
  16.  
  17. Here is a working copy.
  18.  
  19.                Dan Lucey
  20. {-------------------------------------------------------------------------}
  21.  
  22. #max_quotes 200
  23. #OUTPUT_FILE 'TOOMBS1.LST'
  24. FORM_C_DUMP :=0;
  25. FORM_D_DUMP :=0;
  26. FORM_E_DUMP :=0;
  27. FORM_F_DUMP :=0;
  28. FORM_G_DUMP :=0;
  29. FORM_X_DUMP :=0;
  30. FORM_Y_DUMP :=0;
  31. {-------------------------------------------------------------------------
  32. -}
  33. FORML_A : Array;
  34. FORML_A := mov(stoch(20,1),5,'E');            {Formula #28}
  35. {-------------------------------------------------------------------------
  36. -}
  37. FORML_B : Array;
  38. FORML_B := mov(mov(stoch(20,1),5,'E'),5,'E');      {Formula #29}
  39. {-------------------------------------------------------------------------
  40. -}
  41. If FORML_B[0] >= 84 then                      {Formula #30}
  42.    FORM_C_DUMP := 1;
  43.    else
  44.    FORM_C_DUMP := 0;
  45. {-------------------------------------------------------------------------
  46. -}
  47. FORM_X_DUMP := FORML_B[0] - FORML_A[0];
  48. {-------------------------------------------------------------------------
  49. -}
  50. If FORML_B[0] < 70 and (FORM_X_DUMP >= 4) then
  51.    FORM_D_DUMP := 2;
  52.    else                                       {Formula #31}
  53.    FORM_D_DUMP := 0;
  54. {-------------------------------------------------------------------------
  55. -}
  56. FORM_E_DUMP = FORM_C_DUMP + FORM_D_DUMP;      {Formula #32}
  57. {-------------------------------------------------------------------------
  58. -}
  59. If FORML_B[0] > 30 and (FORM_X_DUMP <= -4) then
  60.    FORM_F_DUMP := -1;
  61.    else                                       {Formula #33}
  62.    FORM_F_DUMP := 0;
  63. {-------------------------------------------------------------------------
  64. -}
  65. FORM_G_DUMP := FORM_E_DUMP + FORM_F_DUMP;     {Formula #34}
  66. {-------------------------------------------------------------------------
  67. -}
  68. {Test program to determine if SAR can be used with TOOMBS STOCHASTIC}
  69. T_SAR : Array;
  70. T_SAR :=SAR(.02,.20);
  71. {------------------------------------------------------------------------}
  72. If (T_SAR[0] < C[0]) then
  73.    FORM_Y_DUMP := 1;
  74. else
  75.    FORM_Y_DUMP := -1;
  76. {-------------------------------------------------------------------------
  77. }
  78. If first_ticker then
  79. begin
  80. Writeln('Tick    Name                  Close    Toombs   SAR    Action');
  81. Writeln(' ');
  82. end;
  83. begin
  84. Write(TICKER,FULLNAME,'\t',C,'  ',Int(FORM_G_DUMP),'  ',Int(FORM_Y_DUMP));
  85. If ((Int(FORM_G_DUMP) = 2) and (Int(FORM_Y_DUMP)= 1)) then
  86. Writeln('    ***BUY***  ')
  87. else
  88. If ((Int(FORM_G_DUMP) = -1) and (Int(FORM_Y_DUMP) = -1)) then
  89. Writeln('    ***SELL*** ')
  90. else
  91. Writeln('               ');
  92. end;
  93.  
  94. {--------------------END TOOMBS.TAS-------------------------------------}
  95.