Sandro Begashvili / Publications
Codes
Smart Money Concept Expert Advisor - Market Strucutre, FVG, Pullback for MetaTrader 5
This Expert Advisor trades fair value gaps in the direction of market structure, the way Smart Money Concepts describes it. It is the third step of a series that has been built one piece at a time: In previous shared codes, the SMC Pullback Indicator decided which highs and lows matter, the SMC
Market Structure from Pullback Swings — BOS, CHoCH, IDM for MetaTrader 5
Smart Money Concepts market structure on pullback swings: trend, BoS, CHoCH, IDM and liquidity sweeps. A level counts as taken only on a close — a wick through it is marked as a sweep (x) and relocates the swing. Self-contained, closed bars only
Swing Detector by Pullback (Smart Money Concepts) for MetaTrader 5
SMC Pullback marks swing highs and lows using the pullback definition instead of the usual 3-candle pattern. A high is confirmed only when price trades back through the low of the candle that made it — so every marked point is an actual rejection, and highs and lows always alternate. It evaluates
Articles
Building a PDF Creation Library in MQL5 (Part 3): The Byte-Exact Writer for MetaTrader 5
The article presents CPdfBuffer and CPdfWriter, a minimal MQL5 pair that derives all offsets from the output buffer instead of hand-maintaining numbers. CPdfWriter records object starts, writes a fixed-width cross-reference table and trailer, and ensures structural consistency. The result passes
Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 7): Arcs, Circles and Rounded Rectangles for MetaTrader 5
This part finishes the geometry layer: arcs use a sagitta‑based angular step tied to the pixel tolerance, so segment counts are computed, not guessed. The path gains ArcTo, AddCircle, AddEllipse and AddRoundRect with per‑corner radii, enabling common UI shapes such as tabs, pills, badges, rings
Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 6): Curves and Adaptive Flattening for MetaTrader 5
This part introduces cubic Bézier curves and a quadratic verb, flattened on append by recursive midpoint splitting (De Casteljau). A conservative flatness test sums distances of control points to the chord and stops within a pixel-based tolerance, adapting detail to curvature. The design keeps
Building a PDF Creation Library in MQL5 (Part 2): Why PDFs Break for MetaTrader 5
Learn how a viewer opens a PDF backwards, why xref entries must be exactly 20 bytes, and how a two-character change falsifies multiple offsets. We reproduce three typical failures, compare results in PDFium and pypdf, and extract four strict checks a generator must pass. The included PdfValidate.mqh
Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 5): Fill Rules, Holes and Borders for MetaTrader 5
Part 5 adds a fill rule to the rasterizer and a stroke helper to the path. The engine now supports both non-zero and even-odd fills via a single enum parameter, enabling rings, true borders that do not repaint interiors, and glyph counters. AddThickLine() builds strokes from fills in one path and
Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 4): Anti-Aliasing, Coverage and Compositing for MetaTrader 5
The rasterizer now accumulates exact span coverage in X and sampled coverage in Y, and blends it via CairoBlendOver on straight ARGB. CairoAaSamples sets the number of vertical samples at runtime, making the cost nearly linear and localized to edges. Readers get smoother boundaries, correct
Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 3): Edges and the First Filled Shape for MetaTrader 5
Part 3 implements a scanline rasterizer in pure MQL5. We convert path segments into top‑down edges, sweep each row, sort crossings, and apply the non‑zero winding rule to decide which pixels are inside. The result is a single Fill(path, color, buffer, w, h) routine that draws rectangles, stars
Building a PDF Creation Library in MQL5 (Part1): Writing a PDF by Hand for MetaTrader 5
This article shows how a PDF works as plain text by hand‑written two files: a 592‑byte page and an 885‑byte trade ticket. It explains the file structure (header, body, xref, trailer), the required page objects and resources, and the operators that draw text, then provides an MQL5 script to generate
Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 2): Points, Contours and the Path for MetaTrader 5
This second part adds the geometry layer to a Cairo‑inspired graphics library for MetaTrader 5. It defines a path of double‑precision points grouped into contours, records open/closed intent, and stores vertices in a flat array with start indices. We implement MoveTo, LineTo, Close, provide basic
Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 1): Why the terminal needs its own 2D-renderer Contents for MetaTrader 5
This article opens a step-by-step 2D graphics engine for MetaTrader. It standardizes ARGB colors and implements a reusable surface: a uint pixel buffer uploaded as a dynamic resource and shown via one OBJ_BITMAP_LABEL. You will draw rectangles and a vertical gradient, check real transparency, and











