The stochastic oscillator is a leading momentum indicator. It is also called STOCH for short. STOCH compares the latest close with the recent trading range. Fast K is a ratio and has a value between 0 and 100. Fast K can have haphazard movement, and hence it is smoothed using a moving average, which is the slow K. Slow K is further smoothed using another moving average, which is the slow D. Values of slow K over 75 indicate an overbought condition, while values below 25 indicate an oversold condition. When slow K crosses above slow D, it is considered a buy signal. Similarly, when slow K crosses below slow D, it is considered a sell signal.
The formula for computing STOCH is as follows:
MA stands for moving average, and can be either SMA or EMA. For this recipe, we have used SMA. This formula needs three time periods: one of them is n and the other two are the time periods of the MAs. The range over which we analyze data is defined by...