Discussing the article: "MQL5 Bootstrap (I): Reusable Functions for Working with Positions and Orders"

 

Check out the new article: MQL5 Bootstrap (I): Reusable Functions for Working with Positions and Orders.

This article presents a compact MQL5 utility layer for routine trade operations. It includes position existence checkers, position counters, bulk close helpers, and functions to retrieve the most recent or oldest position by symbol, magic, or type. A simple SMA crossover Expert Advisor demonstrates integration. The result is cleaner EAs, fewer inconsistencies across projects, and faster maintenance.

Have you ever found yourself rewriting the same functions over and over again during development? If you’ve built more than a few Expert Advisors, Scripts, or Indicators, chances are, you have.

Across different trading systems, certain boilerplate tasks repeat constantly. For example, almost every expert advisor needs trade monitoring and management, trailing stops, breakeven triggers, partial closes, position counting, order detection, deal history inspection, and reliable methods for closing or removing trades. These are not strategy-specific features; they are structural necessities.

Author: Omega J Msigwa

 
Yeah, this is a great project and idea too. MQL5 should have standardised libraries for various common patterns and tasks.