Random Expansion - MetaTrader 5 Script - MQL5 #19992 - MT4/MT5 Resources



The Stochastic Oscillator is a momentum indicator that compares a security's closing price to its price range over a certain period of time. The sensitivity of the oscillator to market movements can be reduced by adjusting the time period or taking a moving average of the results.
The stochastic oscillator is calculated using the following formula:
The general theory underlying this indicator is that when the market is trending upward, the price will close near the highs, and when the market is trending downward, the price will close near the lows. A trading signal is generated when %K crosses the three-period moving average (called %D).
A common average used for stochastic calculations is the Simple Moving Average (SMA). This version allows you to use any of 4 basic types of averages (the default is SMA, but you can also use EMA, SMMA or LWMA) - some are "faster" than the default ones (like the EMA and LWMA versions), while SMMA is a bit "slow", but this way you can fine-tune the ratio of "speed" to signal.

Attachment download
📎stochastic_extended.mq5 (16.09 KB)
Source: MQL5 #19992
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •