Return value of the smoothed stochastic oscillator for the selected price. Also known as the slow stochastic.
Syntax:
1 |
SmoothedStochastic[N,K](price) |
Calculation :
The calculation of the %D is similar to the stochastic rapid but with the smoothing the signals are more regular.
%D(y) = 100 * (H(y)/B(y))
with :
H(y) : sum of C – PH(n) on X days ago
B(y) : sum of PH(n) – PB(n) on X days ago
C days : today’s close
PB(n) day : lowest on n period
PH(n) : Highest on n period
n : period
A sell signal is given when a bearish divergence appears. A bearish divergence occurs when the stock price makes new highs while the smoothedstochastic fails to make new highs.
A buy signals is given when a bullish divergence appears. A bullish divergece occurs when the stock price makes new lows while the smoothestochastic fails to make new lows.
When %k and %d are under the 20 level, there is a bullish signal when %k rises above %d and when the two lines rise above the 20 level. When %d and %k are above the 80 level, it is a bearish signal when %k falls below %d and when the two lines falls below the 80 level.
Example:
1 2 3 4 5 6 7 8 9 |
mySMI = SmoothedStochastic[14,3](close) if(highest[14](mySMI)>mySMI) THEN signal = 1 else signal = 0 ENDIF RETURN signal |
hello
Where are %k and % d ?
%k is the main stochastic line, while %d is a moving average of %k.
%d is calculated with this simple code:
d = average[period](mySMI)
Thanks Nicolas