DownloadRe: MT5 Moving Averages (MAs)

352
Step VMA VHF Pro V2

An adaptive trend-following indicator built around a VHF-driven Variable Moving Average with stepped price filtering to reduce noise and highlight meaningful trend changes.

It includes:

• Adaptive VMA using VHF-based market-regime adjustment
• Fixed or ATR-normalized dynamic Step filtering
• Optional 3-pole Super Smoother bias filter with selectable price source
• Optional ADX strength confirmation
• Optional +DI / -DI directional confirmation
• Closed-bar BUY/SELL signal dots
• Popup, sound and push-notification alerts
• Adjustable line, dot and display settings

Entries & Re-Entries

With a larger Super Smoother period, the SS acts as the main trend bias while the Step VMA provides faster timing.

A fresh Step VMA flip in the same SS direction can therefore act as a **trend entry or re-entry after a pullback**.

The Step VMA remains the trigger; the SS simply filters the direction.


Signals are generated only from closed candles so no repainting. The filters work as confirmation gates around fresh Step VMA trend changes rather than producing delayed entries after the original flip.

Re: MT5 Moving Averages (MAs)

353
Hello everyone! I share indicator which change colors when slope change, you can adjust slope level and type ma, also smoothing and alerts are included - unfortunately is in polish language, because im not programmer - its pure AI maked indicator based on my idea. You can do all with this code, add candles, arrows, types ma - enjoy!
These users thanked the author m1n3k for the post (total 4):
Eis, AlainP, ashdays, Ricstar_8

Re: MT5 Moving Averages (MAs)

355
Hello, this indicator is a two-moving-average crossover strategy, but it includes a built-in backtester that optimizes the values of the fast and slow MAs while determining the best exit strategy. This is illustrated by a trend line that makes it easy for you to see both losing and winning trades. If you hover over the trend line, you’ll find additional information such as the trade type and how much you earned or or lost on that trade. It also includes a system to prevent overfitting: it trains on 70% of the candlesticks (the number of which you specify in the settings) and tests the robustness of the winning settings on 30% of future candlesticks that the indicator has not yet seen. It calculates the out-of-sample performance ratio (WFE) compared to in-sample performance, and if the strategy fails to meet the 50% WFE requirement for the settings or the number of out-of-sample (OOS) trades falls below 3, the indicator immediately displays: STATUS: OVERFITTING DETECTED ❌ and resets the signals to zero and completely blocks them to protect against market noise, with the option to run the auto-optimization counter to automatically find the best settings after a certain period. You won’t need to optimize again because the optimization data for each pair and time frame is stored in the “Files” folder; so if you close and reopen the platform, the indicator will apply the saved settings.
You can adjust, explore, and change the settings as you see fit to achieve the best results for you, or use them with other tools such as filters based on market structure.

Question: Is there a thread on ForexStation dedicated to this type of indicator? (I mean self-optimizing indicators.)
These users thanked the author enthusiastiAIuser for the post (total 3):
Shink, ionone, Ricstar_8

Re: MT5 Moving Averages (MAs)

356
AVWAP with ATR pivot anchoring

I started using and studying the XU Sema3 VWAP but I was not happy with the explicit repaint issue. I know a lot of Xard indis are made this way, but for my automated trading this is not acceptable. So I tried to take a different path.
The original anchors its VWAP segments to ZigZag pivots, and that ZigZag is a classic repainter:
The Backstep loop zeroes pivots that were already written (Low_Buffer[i+j] = 0).
A second pass, driven by static variables (last_highpos, last_lowtwo…), deletes older pivots whenever a more extreme one appears, at any distance in the past. Repaint_Guard_Bars only skips the newest bars. It does not protect pivots already drawn.
Each VWAP segment is anchored to a pivot, so every deleted or moved pivot rewrites the VWAP behind it.
Using static state also made history, visual tester and live results diverge.

A ZigZag can't be made non-repainting by patching it, because its definition of "the swing" depends on future bars. Instead, my engine is a small state machine where each bar looks only at the previous bar's state:

Code: Select all

tracking a LOW:
   if low < extreme          -> extreme = low            (trend continues)
   elif high > extreme + ATR(14) * K
                             -> reversal confirmed:
                                anchor = bar before the confirming bar
                                new AVWAP segment starts, zone flips to BUY
                                now tracking a HIGH (mirror logic)
  • The reversal threshold is adaptive (ATR × multiplier, default 5.0), so it works on forex, gold, crypto and indices without retuning points.
  • All state (ATR, direction, extreme, anchor, cumulative sums) lives in hidden INDICATOR_CALCULATIONS buffers. No static, no globals, forward loop only.
  • The AVWAP is anchored where the reversal is confirmed, not at the exact extreme. That is the price of stability: the flip lags, and higher multipliers lag more.
The recalculation window is the actual anti-repaint rule

On every call only rates_total − 2 onward is recomputed: the last closed bar and the forming bar. Anything older is never touched again.
  • When bar i confirms a reversal, the anchor is written on bar i−1, while i is still forming.
  • Once bar i closes, nothing before it changes.
  • On the live bar the confirmation can appear intrabar and, on a rare outside bar, disappear again before the close. At the close, the live result equals a full recalculation.

I also added volume-weighted SD bands at ±1 and ±2 SD: they use Σ(V·P²)/ΣV − VWAP². This needs one extra running sum, so they are computed incrementally and follow the same write-once rule. Only the bands of the active zone are drawn.

I believe this is the best compromise between anchoring and non-repainting.
These users thanked the author AlgoAlex811 for the post:
chris006
My professional trading tools:
Mql5 "alexf81"