Discussing the article: "Creating Custom Indicators in MQL5 (Part 13): An Accelerating Trend Stop Confirmed by VWAP"

Check out the new article: Creating Custom Indicators in MQL5 (Part 13): An Accelerating Trend Stop Confirmed by VWAP.

We implement an adaptive trend stop indicator in MQL5 that reseeds on every flip, then accelerates toward price, with speed boosted by distance from VWAP and all distances scaled by ATR. The article covers the acceleration engine, the VWAP agreement filter that grades each flip, the anti-aliased stop line with its cloud, and persistent flip levels and arrows. The result highlights where the trend turned and whether VWAP agreed.

A trailing stop that moves at a fixed distance treats every market the same. When price drifts sideways, the stop is too far away and gives back much of the move before it signals the trend is over. When price runs, the stop is too close and gets clipped by noise. We also flip on every close through the line without confirmation, treating reversals and single overextended candles the same. This article is for MetaQuotes Language 5 (MQL5) developers and traders who want a stop that adjusts its own urgency and tells us which of its flips deserve attention.

In our previous article (Part 12), we mapped traded volume with a volume profile heatmap. In this article, we build a trend stop that reseeds a fixed number of slow Average True Range (ATR) multiples away on every flip, then accelerates toward price bar by bar, gaining speed faster the further the market has run from its Volume Weighted Average Price (VWAP). Every flip is then graded against the session, weekly, and monthly VWAP, and the chart keeps the level and the arrow it left behind. By the end of this article, we will be able to:


Author: Allan Munene Mutiiria