Discussing the article: "MQL5 Trading Tools (Part 35): Adding Channel, Pitchfork, Gann, and Fibonacci Tools to the Canvas Drawing Layer"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: MQL5 Trading Tools (Part 35): Adding Channel, Pitchfork, Gann, and Fibonacci Tools to the Canvas Drawing Layer.
We extend the canvas drawing layer from the previous part with seven new categories of multi-anchor analytical drawing tools, covering three channel variants, three pitchfork variants, three Gann tools, and the six Fibonacci tools. We work through how each tool encodes its geometry on the canvas, how derived handles let users reshape compound shapes coherently, and how shared helpers handle ray clipping, scanline filling, and anti-aliased arc rendering. By the end, we will have a full set of analytical drawing tools that live on the same interactive canvas alongside the basic line tools from the previous part.
The line tools we shipped in the previous part all share a common shape. They are defined by at most two anchor points, every handle on them sits directly on one of those anchors, and the geometry the engine renders is a direct function of those anchors, with no derived points in between. This works for trendlines, rays, rectangles, and the other basic tools, but it breaks the moment we try to model a channel, a pitchfork, a Gann fan, or any Fibonacci tool — these need more anchors, derived handles, per-tool level arrays, or geometry computed from market data at every redraw.
The new tools fall into three architectural buckets. Some require three-click placement because their geometry needs three anchors — the first two clicks define a baseline, and the third picks an offset, a projection origin, or an apex. Others derive handles from existing handles to preserve geometric invariants — the parallel channel's fourth corner is computed from the other three, the regression channel's endpoints come from an ordinary least squares fit to the bars in the time window, and the pitchfork's median tine starts at a derived point that differs across the Andrew, Schiff, and modified Schiff variants. The Fibonacci tools add a third twist: each one renders a family of ratio lines or arcs whose ratios, colors, and visibility flags live on the drawn object itself as a level array the engine reads at every redraw. This architecture was inspired by the default MQL5 web chart system, which uses shaded tools, unlike the terminal tools that have mostly lines, and lack opacity control. See a representation below.
Author: Allan Munene Mutiiria