Articles, Library comments - page 3

Contract Sizer: ladder, floor and a breaker that survives a deposit : Three position-sizing protections that do different things; confusing them is why so many accounts get wiped out: - ladder: one contract per X of balance, always applied as a CAP, even with manual lot sizing; - floor: below the
Safe Logger: why your log lines vanish while FileOpen keeps returning success : Four EAs writing to the same file, all with FILE_SHARE_READ|FILE_SHARE_WRITE, FileSeek(SEEK_END), FileWrite, FileClose. Looks correct. Every FileOpen returns success. No error in the log. And the lines vanish. Reason
Gold Hour Profile - when gold moves, and when the spread eats it : Measures, hour by hour, how far a symbol travels and how much of that the spread takes away. Built for gold, works on any symbol, compares several side by side. Author: Petr Kostal
Check out the new article: Price Action Toolkit Development (Part 18): Introducing Quarters Theory (III) — Quarters Board . In this article, we enhance the original Quarters Script by introducing the Quarters Board, a tool that lets you toggle quarter levels directly on the chart without needing to
Check out the new article: Market Simulation: Position View (X) . We need a way to handle the graphical objects we create. The approach presented in the previous article works very well for certain scenarios. In this case, we will need something more complex, given the specific nature of the problem
Check out the new article: From Basic to Intermediate: Queues, Lists, and Trees (II) . This is an article that you, dear reader, should study carefully. That is due to the nature of the material presented here. Although we have tried to present the material as simply and informatively as possible
Check out the new article: Price Action Analysis Toolkit Development (Part 81): Adding Persistent Historical Bookmarks to an MQL5 Navigator . We introduce a persistent bookmark layer for the MetaTrader 5 History Navigator. Bookmarks capture a chart's symbol, timeframe, and historical position with a
CGoldSymbol - find the broker's gold and size the position correctly on it : Detects the gold symbol whatever the broker calls it, reads the contract specification from the terminal instead of assuming it, and turns a risk in account currency into a lot size that is correct for that broker. Author
OHLC Reality Check - at what stop distance does your backtest start lying? : Opens a virtual bracketed trade on every M1 bar, walks it forward on the real tick history, and reports for a sweep of stop distances how often 1-minute OHLC modelling would score the trade the wrong way round. Author: Petr
Check out the new article: Market Simulation: Position View (IX) . In this turning-point article, we will begin to explore in greater depth the interaction between the applications we are developing to ensure full support for the replay/simulation system. Here we will analyze a problem that, on the
SessionReopenEA : Gold has a daily maintenance break on the CME. The first hour after it rises more than chance explains, in every calendar year of an 11-year sample - while every other hour of the day measures flat. One trade per session, a volatility-scaled server-side stop, no averaging or grid
MACD Candles : MACD color candles for Metatrader 5 Author: Andrew Ingosi Likare
New article Step-by-Step Guide to Writing an Expert Advisor in MQL5 for Beginners is published: The Expert Advisors programming in MQL5 is simple, and you can learn it easy. In this step by step guide, you will see the basic steps required in writing a simple Expert Advisor based on a developed
Trade Excursion Report: MFE and MAE of every closed trade, to CSV : Exports one CSV line per closed trade with the numbers a statement does not carry: the best unrealised profit the trade showed (MFE), the worst unrealised loss it survived (MAE), how much of the MFE was actually kept, how many bars
Trade Excursion: how much of each winner you actually kept (MFE/MAE from your own history) : Your statement tells you what you KEPT. It does not tell you what you HAD. This indicator reads your own closed trades from the account history and draws, for each one, the full range it travelled: the best
Decision Watchdog: refuse yesterday's decision, fail closed, log once : A daily process writes "today's decision" (which strategy runs, or FLAT) to a file the EAs read at the open. One day the writer did not run. The EAs read yesterday's file, compared its date with TimeCurrent() - the server clock
Exposure Cap: one position limit per symbol across all your EAs : Four EAs on the same symbol, each one honest on its own: each checks "do I have a position?" with its own magic number, sees none, and enters. On a demo account this reached 22 contracts on a symbol meant to carry 1, and a watchdog
Server Time Offset: the three clocks in MQL5 and how timestamps shift on export : A datetime in MQL5 is seconds since 1970 - but server time (TimeCurrent, bar times, deal times) is the broker's wall clock stored AS IF it were UTC. Export it to CSV, read it in Python or a spreadsheet with a "seconds
Tick Audit - check real tick history and backtest quality month by month : Reports, month by month, whether your symbol really has ticks or only bars - so you know which part of your backtest ran on generated ticks before you trust the curve. The Strategy Tester gives you one History Quality figure
GDS Renko Donchian Demo EA : A small educational Expert Advisor showing how a classic Donchian breakout can be applied directly to completed Renko bricks. Author: Andrey Goida
Check out the new article: Network Momentum for MetaTrader5: Trading the Lead-Lag Graph Between Markets . This article builds a trend-following Expert Advisor that trades momentum spillover across markets, implemented fully in MQL5 without external solvers. It detects leaders with Derivative Dynamic
Risk-Based Lot Size Calculator : A simple MQL5 script that calculates the correct lot size for a trade based on your account risk percentage and stop loss distance in pips, so every trade risks a consistent, controlled amount of your balance. Author: Rana Ali
Correlation-Aware Lot Size Calculator : Sizes your next trade based on the correlated risk you already have open across other positions — not just the trade in isolation. Author: Rana Ali
Prop Firm Rule Checker : Checks your trade history against common prop-firm challenge rules — profit target, max daily loss, max drawdown, consistency rule, and minimum trading days — with a clear PASS/FAIL report. Author: Rana Ali
ErrorHandler - Trade Error Classifier for MQL4 : Trade error classifier and automated retry back-off framework for MQL4 Expert Advisors. Author: Martin Koprla
SMC Entry Using structure : Market Structure & Smart Trade Tracker (MT5) An advanced all-in-one Smart Money Concepts (SMC) indicator that combines automated market structure mapping, momentum heatmap candles, and institutional trade execution tracking. Author: Asma Batool
Lavika EURGBP/EURUSD : The Expert Advisor uses four iMA (Moving Average, MA) indicators from two timeframes. Two indicators with averaging periods 1 and 8 are created on the H1 timeframe and two indicators with averaging periods 2 and 24 are also created on the H4 timeframe. Author: Erin Lavika
TrueCostReport : Cost is the one input to a trading system that is knowable exactly, and it is almost always estimated wrongly - always in the direction that flatters the strategy. This EA measures what one round trip really costs on YOUR broker: the live spread sampled from ticks, the swap for both
SuperTrend TV EA : An Expert Advisor that trades the SuperTrend TV indicator through iCustom on closed bars only, shipped with the audit that proves every trade matches a signal and no signal was missed Author: Mykyta Samoiliuk
Any Indicator Alert - alerts, push notifications and multi-timeframe for any custom indicator, no source code needed : Attach it to a chart, type the name of any custom indicator, and it alerts you on that indicator's own buffers - popup, sound, push notification to your phone, or email. It reads