Step Random - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources - MetaTrader 5 Resources

I've always liked the idea of step randomization since I first saw it. But every version I've seen has two very serious flaws:
The average true range of minimum and maximum values is inherited from the previous bar
Therefore it makes it dependent on the number of bars used in the calculation. The rest of the calculation depends on this "inherited" value, and, since the minimum and maximum values get larger (max) and smaller (minimum) over time, the "step quality" of the step, the randomness disappears when enough bars pass by. So the step random variable deforms and is no longer the "step" random variable at the latest bar.
This solves these problems. The idea is simple - instead of inheriting the previous state of the ATR minimum and maximum values, the minimum and maximum values are checked for the "window" number of past bars. This way it won't warp and responds pretty well to the latest data. Comparing to "old" you will notice that initially they have the same value (because "old" still has no "deformation") but over time the difference becomes bigger and bigger. This is the end of the non-inherited effect without redrawing.
> 
Attachment download
📎 step_stochastic.mq5 (8.59 KB)
Source: MQL5 #16718
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •