Articles & tutorials

Blog

MQL5 tutorials, MetaTrader tips and product guides. All free to read.

How to calculate position size in MetaTrader — pips, lots, leverage and the formula

What a position size calculator really decides, why a pip is not a point, why leverage is not in the formula, and how to compute lot size correctly in MQL5 — with a free calculator at the end.

Read more

Why your backtest results differ from live trading

Spread, commission, slippage, modelling mode, history quality and look-ahead bias — the real reasons a profitable MetaTrader 5 backtest turns into a losing account, and how to check each one.

Read more

TradingView-Style Drawing Tools for MetaTrader

MetaTrader ships with a handful of basic chart objects that are awkward to select and style. Rhino Drawing Tools brings the TradingView drawing workflow — toolbar, magnet, quick styling — into MT4 and MT5.

Read more

Export your MetaTrader trades to a clean PDF report

Turn your MetaTrader 4 or 5 account history into a print-ready PDF: a one-page performance summary with an equity curve, followed by a full register of every closed trade.

Read more

How to install and run the free Rhino Backtest Manager demo

Step-by-step: download the free demo of Rhino Backtest Manager, install it in MetaTrader 4 or 5, and place your first manual trade inside the Strategy Tester.

Read more

Rhino Backtest Manager — the complete user manual

Every window and button of Rhino Backtest Manager explained: the control panel, TradeBox, trades and statistics windows, watch list, and what changes between Live and Tester mode.

Read more

My articles on MQL5.com

In-depth technical articles, reviewed and published by MQL5.

All articles

Building a PDF Creation Library in MQL5 (Part 3): The Byte-Exact Writer

Two classes, about 300 lines, and one rule: never calculate a byte offset — ask the buffer where it is. CPdfBuffer and CPdfWriter turn the fragile hand-counted file of Part 1 into something a program can generate correctly every time.

Read more

Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 7): Arcs, Circles and Rounded Rectangles

Arcs derived from the sagitta rather than approximated with a Bézier constant, plus rounded rectangles with a per-corner radius — the one function most interface code will actually call. The geometry layer is finished here.

Read more

Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 6): Curves and Adaptive Flattening

Cubic Bézier curves in pure MQL5, flattened by De Casteljau subdivision that stops where the curve is already flat enough — so a gentle sweep costs few vertices and a tight bend gets the detail it needs, from one tolerance setting.

Read more

Building a PDF Creation Library in MQL5 (Part 2): Why PDFs Break

Three deliberately broken PDFs that every viewer still opens correctly — and why that is the problem. Introduces PdfValidate.mqh, the first permanent file of the library, which checks whether a file’s byte arithmetic actually adds up.

Read more

Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 5): Fill Rules, Holes and Borders

Two fill rules — non-zero and even-odd — and the small change to the rasterizer that turns an inner contour into a real hole: the letter A, donuts, gauges and borders, without ever guessing the background colour.

Read more

Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 4): Anti-Aliasing, Coverage and Compositing

Replacing the inside-or-outside test with fractional coverage, so that smooth edges and real transparency stop being two problems and become the same arithmetic.

Read more

Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 3): Edges and the First Filled Shape

Turning a path into pixels: edges, the winding number, and a scanline rasterizer that fills any shape — holes included — with one routine that never asks what it is drawing.

Read more

Building a PDF Creation Library in MQL5 (Part1): Writing a PDF by Hand

A PDF is a text file with an index at the bottom. Part 1 types two working PDFs by hand — 592 and 885 bytes — explains every character, then generates them from MQL5. No DLL, no library.

Read more

Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 2): Points, Contours and the Path

One geometry representation for every shape: points, contours and the path, with MoveTo, LineTo and Close — so a single fill routine can later draw anything.

Read more

Creating a Cairo-Inspired Graphics Library for MetaTrader 5 (Part 1): Why the terminal needs its own 2D-renderer

Why MetaTrader 5 needs a real 2D renderer, and the two building blocks everything else rests on: an ARGB color type and a pixel surface bound to one chart object.

Read more