curtis33e 15 posts msg #98114 - Ignore curtis33e |
12/19/2010 3:24:06 PM
I know that Stockfetcher already has a KST filter. However, I found a formula for it and I am not able to get the same reults as SF. Can anyone help me in fixiing my code? This is what I have below. and below that is the formula that I found on the web.
set{A1,close}
set{B1,close 10 days ago}
set{C1,close 15 days ago}
set{D1,close 20 days ago}
set{E1,close 30 days ago}
Set{A2,1 - a1}
set{A3,A2 / B1}
set{A4,A3 * 100}
set{B3,A2 / C1}
set{B4,A3 * 100}
set{C3,A2 / D1}
set{C4,C3 * 100}
set{D3,A2 / E1}
set{D4,D3 * 100}
set{MOVA,A4}
set{MOVB,B4}
set{MOVC,C4}
set{MOVD,D4}
set{MOV1A,movA(10)}
set{MOV2A,movB(10)}
set{MOV3A,movC(10)}
set{MOV4A,movD(15)}
set{MOV1, MOV1A * 1}
set{MOV2, MOV2A * 2}
set{MOV3, MOV3A * 3}
set{MOV4, MOV4A * 4}
set{CST1, MOV1 + MOV2}
set{CST2, MOV3 + MOV4}
set{CST, CST1 + CST2}
draw CST daily sma
Sunday, March 2, 2008KST Indicator
KST (The Know Sure Thing) Indicator
This indicator was first introduced in the early 1990s. It uses four rate of change values to determine the trend of the market.
The formula is as follows:
ROC1 = (1-Price/Price(X1))*100;
ROC2 = (1-Price/Price(X2))*100;
ROC3 = (1-Price/Price(X3))*100;
ROC4 = (1-Price/Price(X4))*100;
Where Price refers to current closing price and Price(X1) refers to the closing price X1 bars ago.
KST = MOV(ROC1,AVG1)*W1 + MOV(ROC2,AVG2)*W2 + MOV(ROC3,AVG3)*W3 + MOV(ROC4,AVG4)*W4
Where MOV(ROC1,AVG1) refers to the AVG1 day moving average for ROC1
For Short term trend, Martin J Pring suggest the following parameters:
X1 = 10
X2 = 15
X3 = 20
X4 = 30
AVG1 = 10
AVG2 = 10
AVG3 = 10
AVG4 = 15
W1 = 1
W2 = 2
W3 = 3
W4 = 4
|