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

  1. {Martin below is KST script we've talked about.  I think you or your      }
  2. {customers may find it interesting.  David S. Landry, *P* MMMJ96A         }
  3. { This script displays three KST indicators: the short, immed., and long  }
  4. { The "Know Sure Thing" was developed by Martin Pring.  It takes 4 rate   }
  5. { of changes smoothes and weights them for the time period then sums them }
  6. { up.  You can change the values of R1..R4 to get different time periods. }
  7. { Buy when the KST rises above the trigger and sell when it falls below.  }
  8. { Use the three time periods to help you make your decision.  Also, strong}
  9. { buy signals are given when the KST falls below zero then rises above    }
  10. { zero.}
  11. {Below is a "beta" version......I feel it can still use further           }
  12. {documentation and improvements...it requires TAS 4.08 w/ Graph feature   }
  13.  
  14. #MAX_QUOTES 200
  15. {}
  16. { Define arrays to be used: }
  17. kst : ARRAY;
  18. kst1 : array;
  19. kst2 : array;
  20. kst3 : array;
  21. roc1 : array;
  22. roc2 : array;
  23. roc3 : array;
  24. roc4 : array;
  25. maroc1 : array;
  26. maroc2 : array;
  27. maroc3 : array;
  28. maroc4 : array;
  29. temp1 : array;
  30. temp2 : array;
  31. {Values for a short term KST:}
  32. r1 = 3;
  33. r2 = 5;
  34. r3 = 7;
  35. r4 = 10;
  36. gosub calckst;
  37. kst1 = kst;
  38. {Values for a immed. KST:}
  39. r1= 10;
  40. r2= 15;
  41. r3= 20;
  42. r4 = 30;
  43. gosub calckst;
  44. kst2 = kst;
  45. {Values for a long term KST:}
  46. r1 = 40;
  47. r2 = 60;
  48. r3 = 80;
  49. r4 = 100;
  50. gosub calckst;
  51. kst3= kst;
  52. gosub graphit;
  53. end;
  54. :calckst
  55. if QUOTE_COUNT > 100 THEN
  56. BEGIN
  57.    {calculate ROC }
  58. roc1=ROC(c,r1,'%');
  59. roc2=ROC(C,r2,'%');
  60. roc3=ROC(C,r3,'%');
  61. roc4=ROC(C,r4,'%');
  62. {calculate MA on each array}
  63. maroc1=mov(roc1,10,'e');
  64. maroc2=mov(roc2,10,'e');
  65. maroc3=mov(roc3,10,'e');
  66. maroc4=mov(roc4,10,'e');
  67. {weight each array}
  68. mulby(maroc1,1); {redundant statement, used for clarity}
  69. mulby(maroc2,2);
  70. mulby(maroc3,3);
  71. mulby(maroc4,4);
  72. {sum up all the arrays}
  73. temp1 = ADD(maroc1,maroc2);
  74. temp2 = add(maroc3,maroc4);
  75. kst = add(temp1,temp2);
  76. end;
  77. return;
  78. {}
  79. :graphit
  80. {Graph the three KSTs and display a 10 day MA "trigger"}
  81. {You may want to experiment withe the trigger on the individual}
  82. {KSTs}
  83. OPENGRAPH(4);
  84. sizegraph(1,1,1,2);
  85. graph(kst1,'Short KST',mov(kst1,10,'e'),'10day MA');
  86. graph(kst2,'Immed KST',mov(kst2,10,'e'),'10day MA');
  87. graph(kst3,'Long  KST',mov(kst3,10,'e'),'10day MA');
  88. graph(1);
  89. closegraph();
  90. return;
  91.