MQL Articles is a repository that contains the basic structure of the complete framework by Leo\Nique_372 (TradeSystemsNique - TSN), in addition to containing the codes that nique_372 implemented in his MQL5 articles (Ict, Risk Management, Position Management).
  • MQL5 93.8%
  • MQL4 6.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nique_372 dac3a3c730
2026-09-06 20:42:03 -05:00
Defines 2026-03-19 18:23:16 -05:00
Examples 2026-08-28 22:40:45 -05:00
Images new files added 2026-02-26 22:09:18 -05:00
IndicatorsCts new files added 2026-09-06 11:15:27 -05:00
Logos new files added 2026-09-03 15:27:17 -05:00
MqlCompilerBugs new files added 2026-09-02 10:54:12 -05:00
Ob 2026-09-06 20:42:03 -05:00
PosMgmt 2026-09-06 20:42:03 -05:00
RM 2026-09-06 20:42:03 -05:00
Sets/Article_19682 new files added 2025-10-26 16:42:49 -05:00
Strategy new files added 2026-09-06 11:15:27 -05:00
Utils new files added 2026-09-06 20:20:13 -05:00
.gitattributes new files added 2026-08-06 11:51:18 -05:00
.gitignore new files added 2026-08-06 11:51:18 -05:00
CHANGELOG.md 2026-09-06 20:42:03 -05:00
dependencies.json 2026-09-04 11:33:46 -05:00
LICENSE new files added 2026-05-28 12:34:18 -05:00
MQLArticles.mqproj 2026-08-06 11:51:10 -05:00
README.md 2026-09-06 11:35:17 -05:00

MQLArticles Logo

A comprehensive collection of MQL5 implementations for risk management and position management in algorithmic trading. This repository contains the source code from articles published on MQL5.com by nique_372..


Main features

MQLArticles is not a single library: it's an ecosystem of ~13 independent modules (several used in production within the TSN ecosystem). Each folder in the table below is its own library, with its own detailed README inside the folder — this section only summarizes what each one solves.

Module What it solves
RM Risk management: lot size calculation, dynamic SL/TP, OCO orders, max loss/profit limits with automatic position closing.
PosMgmt Open position management: breakeven (by fixed points, ATR or RRR), partial closes by volume, and partial closes conditioned on indicators (RSI, etc.).
Strategy Framework for building EAs by composition: chainable entry filters (RSI, Stochastic, Bands, SuperTrend...), a text-based logic rule engine, and time filters (day/year).
Utils Core of cross-cutting utilities used by the rest of the ecosystem — see submodules below.
  Utils/FA Shared base classes: ATR, pointer auto-cleanup, bar control, simple logging, diffs, sorting.
  Utils/LogFile File logging system with parsing and configurable levels.
  Utils/SetFiles Programmatic generation and editing of .set files (EA parameters).
  Utils/EnumsStr Automatic enum-to-string conversion (with a code generator).
  Utils/Bits Bit manipulation, fast buffers and hashing.
  Utils/StrMatch Simplified string matching (lightweight pattern matching).
  Utils/File File operations and path handling.
  Utils/MBen Benchmarking of multiple code blocks.
  Utils/TfI Timeframe utilities.
IndicatorsCts Generic wrapper for consuming technical indicators with a reusable instance pool.
Ob Order Blocks indicator + example EAs that consume it (published articles).
Examples Working EAs/scripts that put the libraries above into practice (breakeven panel, risk management panel, lot size / SL test scripts).
MqlCompilerBugs Minimal reproductions of MQL5 compiler bugs found while building this ecosystem, each with its own README.
Sets .set preset files used by published articles (currently the partial-close article, #19682).
Defines Notes on optional #defines to enable extra logging/strictness in specific classes across the repo.

Code snippets for each module (with real usage examples) now live in that folder's own README — this root README is the ecosystem map, not the class catalog.


Repository Structure

Folder Description
Defines Markdown files containing optional defines to activate or increase logging verbosity for specific classes in the repository.
Examples Basic examples that implement various libraries from the MQLArticles repository, such as risk management, position management, etc.
Images Screenshots and visual assets from repository examples (breakeven manager, lot size calculator, order blocks indicator).
IndicatorsCts Wrapper library for implementing technical indicators.
Ob Order Blocks indicator implementation and example Expert Advisors from published articles (author: nique_372).
PosMgmt Position management libraries including:
- Breakeven management
- Partial position closure
- Conditional partial closure with indicator-based conditions
RM Complete Risk Management (RM) library modules.
Utils Core utility library for EAs, indicators, and libraries.
Sets Preset configuration files (.set) used in articles published by nique_372.
Strategy Strategy implementation framework for the MQLArticles ecosystem.

Examples

  • Examples\GUI\BE\Ea.mq5

Imagen

  • Examples\GUI\Risk_Management_Panel.mq5

Imagen

  • Ob\Indicator\OrderBlockIndPart2.mq5

Imagen


Implemented Article Series

Risk Management

Part Main Topic Article Link
Part 1 Risk management fundamentals [EN]
Part 2 Lot size calculation [ES]
Part 3 Base class construction [ES]
Part 4 Completing key functions of the CRiskManagement class [ES]
Part 5 Integrating risk management into an EA (Order Block) [ES]

Important Update: The RiskManagement library has been completely renovated since the last publication (part 5).

Position Management - Breakeven

Part Focus Article Link
Part 1 Base class and breakeven by fixed points [ES]
Part 2 Breakeven by ATR and RRR [ES]

Position Management - Partial Closes

Focus Article Link
Implementation of partial closes in MQL5 [ES]

Position Management - Conditional partial closure

Focus Article Link
Implementation of the base class in MQL5 [ES]

Order Block Indicator

Part Focus Article Link
Part 1 Initial implementation of Order Blocks in an indicator [EN]
Part 2 Signal implementation in the Order Block indicator [EN]

License

Read Full License

By downloading or using this repository, you accept the license terms.


Requirements

See the dependencies.json file.


Installation of repo code

cd "C:\Users\YOUR USER\AppData\Roaming\MetaQuotes\Terminal\YOUR ID\MQL5\Shared Projects"
tsndep install "https://forge.mql5.io/nique_372/MQLArticles.git"
  • Using the tsndep command requires the tsndep package (available on PyPI). This command automatically downloads all dependencies and installs every requirement from the repositories.
  • If any part of the system is private, the install will fail. Contact me so I can grant you access (if it's a product, you can purchase it; if you have any questions, don't hesitate to reach out). Check the dependencies.json file for more info.

Contact