|
_SECTION_BEGIN("Stochastic %J");
printf("The KDJ indicator is actually a derived form of the Stochastic with the
only difference being an extra line called the J line." +
" The J line represents the divergence of the %D value from the %K. The value
of J can go beyond [0, 100] for %K AND %D lines on the chart." +
"\nTrading Signals: A negative value of J combined with %K and %D at the bottom
range indicates a strong over sold Signal." +
" Likewise, when the J value goes above 100, combined with %K and %D at the top
range, it will indicate a strong over bought Signal. " +
"\nSettings: Default: 14 period, 3 period, 1 period");
N = Param("Range", 9, 2, 20, 1);
M1 = Param("%K Period", 3, 1, 20, 1);
M2 = Param("%D Period", 3, 1, 20, 1);
RSV = (Close - LLV(Low, N))/(HHV(High, N)- LLV(Low, N)) * 100;
//RSV = (Close - LLV(Low, 9))/(HHV(High, 9)- LLV(Low, 9)) * 100;
//K = EMA(RSV, M1);
//D = EMA(K, M2);
K =AMA2(RSV,1/M1,(M1-1)/M1);
D =AMA2(K,1/M2,(M2-1)/M2);
//K =AMA2(RSV,1/3,2/3);
//D =AMA2(K,1/3,2/3);
J = 3 * K-2 * D;
Plot(J, "Stochastic %J", colorRed);
Plot(D, "Stochastic %D", colorBlue);
Plot(K, "Stochastic %K", colorGreen);
Plot(80, "", colorBlack);
Plot(20, "", colorBlack);
_SECTION_END(); |
|