Looking forward to the teacher rewriting this non-repaint version! StepMA 3D.mq4 into StepMA 3D.mq5. (I can't rewrite it successfully, I always get errors) Infinite kindness!!!mrtools wrote: Fri Sep 26, 2025 8:10 am Hello , kept going around and round with this indicator because of the way the atr minimum and maximum was being done, finally dawned on me this is exactly the same problem as the step stochastic which Mladen fixed. This was his explanation
Since I first saw it, I have always liked the idea of a step stochastic. But every single version I have seen had two very serious flaws:
minimum and maximum average true range are inherited from a previous bar
and thus it makes it depend on the number of bars used in calculations. The rest of the calculations depends on that "inherited" value, and, since with time the minimum and the maximum are just getting bigger (maximum) and smaller (minimum), the "step quality" of the step stochastic is simply lost when big enough number of bars pass. So the step stochastic becomes deformed and is not a "step" stochastic any more on newest bars.
This one solves those issues. The idea is simple — instead of inheriting previous state of ATR minimum and maximums, the minimum and maximum are cheсked in a "Window" number of past bars. That way it is not deformed and is reacting to latest data fairly good. Compared to the "old" ones you will notice that at the beginning they have the same values (since the "old" still did not "deform") but as time passes the differences grow bigger and bigger. That is the effect of not inheriting and in the end of not repainting.
So anyway, used the fixed step stochastic code to make a new non-repainting version. The results are different so posting it here to see if you still want to do the modifications you requested.
Re: MT4 Indicator requests and ideas
21732Hello, maybe this indicator is close to your idea....clickROI wrote: Wed Oct 22, 2025 5:16 pm Me: Would it be possible with your knowledge to code an even better indicator than macd 9-21-6?
Robot: Custom “Super-Trend-MACD” – indicator that usually outperforms the traditional 9-21-6-MACD setup on the M5-AUD/JPY chart
Why might a traditional MACD setup fall short?
Fixed EMA period lengths do not adapt to changing market volatility.
The histogram only shows the difference between the MACD line and the signal line, and does not take into account the actual direction of prices (trend direction).
Noise on a 5-minute timeframe can cause many false crosses if there is insufficient filtering.
Super-Trend-MACD – concept
Two-level filtering:
First level – Adaptive Exponential Moving Average (AE-EMA) using Kaufman’s Adaptive Moving Average (KAMA) logic, which accelerates when volatility is high and slows down when the market is calm.
The second level – the traditional MACD structure (fast EMA – slow EMA) is calculated on top of the AE EMA, so the MACD line is already “processed” from noise.
Super-Trend filter:
A SuperTrend line based on Average True Range (ATR) is calculated (like TradingView SuperTrend). This line acts as a confirmation of the trend direction: when prices are above the SuperTrend line, the trend is considered to be up, below – down.
Signal generation:
Bullish – the MACD line crosses the signal line from below upwards AND the price is above the SuperTrend line AND the histogram is increasing.
Bearish – the MACD line crosses the signal line from above downwards AND the price is below the SuperTrend line AND the histogram is decreasing.
This combination of three components (adaptive EMA + MACD + SuperTrend) reduces false signals, improves trend recognition and keeps the reaction speed in the short term.