Schaff Trend Cycles - MetaTrader 5 Script - MQL5 #486 - MT4/MT5 Resources

The Schaff Trend Cycle Indicator is calculated by calculating stochastic over Masadi using cycle lines. As a result, the developers succeeded in obtaining more stable and reliable indicator script execution results. Charts are virtually immune to the short-term trends that inevitably occur in the market. But if the market situation changes drastically, the indicator will sound an appropriate alert.
The author of the Schaff Trend Cycle Indicator is economist Doug Schaff, whose observations of financial market trading results allowed him to develop and mathematically prove that currency trends rarely behave spontaneously. As time goes by, the trend direction returns to the basic direction, and its cycle of ups and downs begins to repeat, that is, there is a certain periodicity. The reliability of market indicators/oscillators can be greatly improved if this periodicity is taken into account. After extensive research, this theory was confirmed in 2008. Later, Doug Schaff's mathematical model was used to develop the new Schaff Trend Cycle indicator.
In addition to taking into account trend periodicity, two different methods of calculating trend direction changes are used in combination to increase the reliability of the Schaff Trend Period indicator and reduce its number of false activations. These methods are the Smoothed Stochastic Oscillator and MACD.
For illustrative purposes, the indicator's operating range is rated in standard units ranging from 0 to 100. Two trigger levels are used - 25 and 75.
The following parameters are used as input parameters for the Schaff Trend Period indicator settings:
The simplest way to trade Forex using the Schaff Trend Cycle Indicator is to sell currencies when the indicator line drops above the 80 level and buy currencies when the indicator line rises above the 20 level. To minimize the number of false signals, Doug Schaff recommends tracking the following chart behavior model. For a buy signal, the bar following the trigger bar should close above the trigger bar's high. For a sell signal, the bar following the trigger bar should close below the trigger bar low. A trigger bar is a bar formed above the 20 or 80 level signal line.
The presentation variant of this popular indicator allows choosing the smoothing algorithm from ten possible variants:
It should be noted that the Phase parameter has completely different meanings for different smoothing algorithms.
The indicator uses the SmoothAlgorithms.mqh library class (must be copied to the terminal data folder \MQL5\include). The use of the class "Average price series for intermediate calculations without using additional buffers" is described in detail in the article.

Attachment download
📎 smoothalgorithms.mqh (133.8 KB)
📎 schafftrendcycle.mq5 (9.96 KB)
Source: MQL5 #486
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •