Guarda come scaricare robot di trading gratuitamente
Ci trovi su Twitter!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Script

Broker Basket Preflight — read-only contract and minimum-volume diagnostics - script per MetaTrader 5

Fabien Martino
Fabien Martino
30 anni di programmazione. 7 anni di trading. 5 Expert Advisor MetaTrader 5 pubblicati.
Visualizzazioni:
71
Valutazioni:
(1)
Pubblicato:
Aggiornato:
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

Broker Basket Preflight

An original standalone MetaTrader 5 script for checking a broker's multi-symbol configuration before developing or testing a portfolio EA. It reads exact symbols already selected in Market Watch and writes a diagnostic report to the Experts journal. The MQ5 source includes the MIT license and requires no external library, DLL or network request.

Broker Basket Preflight: exact Market Watch names, specifications and quotes, Experts journal calculations

Installation guide: the attached START-HERE.txt explains installation, all three inputs and units, journal labels and a recorded test summary in English and French.

Usage

  1. Copy BrokerBasketPreflight.mq5 to MQL5/Scripts, open it in MetaEditor and compile with F7.
  2. Select each exact broker symbol in Market Watch and allow bid/ask quotes to arrive. Prefixes and suffixes are not guessed.
  3. Run the script on a separate chart. Leave InpSymbols empty for that chart's symbol, or enter a comma-separated basket using your broker's exact names.
  4. Read the SPEC, QUOTE, CALC, WARN, SKIP and SUMMARY lines in the Experts journal. Correct any name, data or specification issue and rerun.

Inputs

  • InpSymbols — empty by default; otherwise one to 64 comma-separated entries. Names are trimmed. Unknown, unselected, empty and duplicate entries are skipped independently so later valid entries can still be inspected.
  • InpMaxQuoteAgeSeconds — default 120. Warns when the last quote is older than this threshold; 0 disables the stale-quote age threshold.
  • InpMaxSpreadPoints — default 0, meaning disabled. An optional spread warning threshold in the broker's points, not pips or account currency.

Outputs

The report shows contract size, minimum/maximum/step volume, aggregate directional volume limit, point, tradable tick size, digits, stops/freeze distances, calculation and trading modes, execution mode and reported market-order filling policies. It checks volume and price grids, synchronization, quote time and spread. These fields follow the MQL5 symbol properties; the current bid/ask is read with SymbolInfoTick.

For valid, grid-aligned quotes and minimum volume, the script estimates isolated BUY and SELL margin, the result of an upward and downward one-tick price move for each side, and the immediate spread-only result for each side. Amounts are labelled in the account currency. OrderCalcMargin and OrderCalcProfit failures are reported as warnings; an unavailable result is never substituted with a fabricated zero. Stale-quote calculations are identified as historical.

Limitations

The script submits no orders and manages no positions. It does not call APIs to change chart settings, Market Watch selections or terminal global variables. It reports no account identifier, balance or position list. Output is journal text only.

Margin estimates ignore current positions and pending orders and are not an available-margin check. Price-move and spread calculations exclude commission, swap and slippage. The script does not validate daily history, indicator signals or trading-session opening times. A clean report does not prove that funds are sufficient or that the broker will accept an order. Custom symbols, stale quotes and missing currency-conversion data require separate review.

Validation

Verified on 7 October 2026: the standalone script compiled in MetaEditor with 0 errors and 0 warnings. An isolated MT5 Strategy Tester smoke test called the same diagnostic through a test-only EA wrapper on US500 with a simulated USD account. It inspected one valid symbol, skipped four invalid/duplicate/empty entries, and produced two margin estimates and six profit probes with zero warnings. Eighteen deterministic helper checks also passed. The wrapper is not part of this submission. This is a software smoke test, not validation of every broker, symbol or account currency.

Français — guide complet

Broker Basket Preflight est un script MetaTrader 5 autonome en lecture seule pour vérifier la configuration d'un courtier avant de développer ou tester un EA multi-symboles. Il lit les noms exacts déjà sélectionnés dans Market Watch et écrit dans le journal Experts. Le source MQ5 contient la licence MIT ; aucune bibliothèque externe, DLL ou requête réseau n'est nécessaire.

Installation et utilisation

  1. Dans MT5, ouvrez Fichier > Ouvrir le dossier des données. Copiez BrokerBasketPreflight.mq5 dans MQL5/Scripts.
  2. Ouvrez le fichier dans MetaEditor et compilez avec F7. Revenez dans MT5 ; actualisez Navigateur > Scripts si nécessaire.
  3. Sélectionnez les noms exacts du courtier dans Market Watch et attendez les cotations bid/ask. Les préfixes et suffixes ne sont pas devinés.
  4. Lancez le script sur un graphique séparé. InpSymbols vide utilise le symbole du graphique ; sinon, saisissez les noms du panier séparés par des virgules.
  5. Lisez l'onglet Experts de la Boîte à outils. Le script s'exécute une seule fois. Corrigez les problèmes signalés, puis relancez-le.

Paramètres et unités

  • InpSymbols : vide par défaut ; sinon, de 1 à 64 entrées séparées par des virgules. Les espaces autour des noms sont retirés. Les entrées inconnues, non sélectionnées, vides ou répétées sont ignorées individuellement ; les entrées valides suivantes peuvent être inspectées.
  • InpMaxQuoteAgeSeconds : 120 secondes par défaut. Avertit si la dernière cotation dépasse ce seuil ; 0 désactive le seuil d'ancienneté.
  • InpMaxSpreadPoints : 0 par défaut, donc désactivé. Le seuil facultatif d'avertissement s'exprime en points du courtier, pas en pips ni dans la devise du compte.

Lire les six catégories du journal

  • SPEC : caractéristiques du contrat, volumes minimal/maximal et leur pas, limite directionnelle, point, tick négociable, décimales, distances stops/freeze et modes de calcul, négociation, exécution et remplissage.
  • QUOTE : bid, ask, spread en points et heure de la cotation.
  • CALC : au volume minimal valide et avec des cotations alignées sur la grille de prix, marge isolée BUY/SELL, résultat d'une variation d'un tick vers le haut et le bas pour chaque sens, et résultat immédiat lié au seul spread. Les montants sont indiqués dans la devise du compte.
  • WARN : condition à examiner ou calcul indisponible. Les échecs de OrderCalcMargin et OrderCalcProfit sont signalés ; un résultat indisponible n'est pas remplacé par un zéro inventé. Les calculs sur des cotations anciennes sont identifiés comme historiques.
  • SKIP : entrée ignorée, par exemple un nom inconnu, non sélectionné, vide ou répété.
  • SUMMARY : nombres de symboles inspectés, d'entrées ignorées et d'avertissements.

Limites

Aucun ordre n'est envoyé et aucune position n'est gérée. Le script n'appelle aucune API pour modifier les graphiques, la sélection Market Watch ou les variables globales du terminal. Aucun identifiant de compte, solde ou liste de positions n'est affiché. La sortie est uniquement du texte dans le journal.

Les estimations de marge ignorent les positions et ordres en attente existants ; elles ne contrôlent pas la marge disponible. Commissions, swaps et slippage sont exclus des calculs de variation de prix et de spread. Le script ne valide ni l'historique quotidien, ni les signaux d'indicateurs, ni les horaires d'ouverture des séances. Un rapport sans avertissement ne garantit ni des fonds suffisants ni l'acceptation d'un ordre. Les symboles personnalisés, cotations anciennes et données de conversion manquantes nécessitent un examen séparé.

Validation technique

Vérifié le 7 octobre 2026 : compilation du script autonome dans MetaEditor avec 0 erreur et 0 avertissement. Un test de fonctionnement dans le testeur MT5 isolé a appelé le même diagnostic via un EA réservé au test, sur US500 avec un compte USD simulé. Il a inspecté 1 symbole valide, ignoré 4 entrées invalides, répétées ou vides, et produit 2 estimations de marge et 6 calculs de résultat, avec 0 avertissement. Les 18 contrôles déterministes des fonctions auxiliaires ont également réussi. L'EA de test ne fait pas partie de cette contribution. Ce test de fonctionnement ne valide pas tous les courtiers, symboles ou devises de compte.

AgentGuard — Independent Risk Guard for AI Agents in MetaTrader 5 AgentGuard — Independent Risk Guard for AI Agents in MetaTrader 5

AgentGuard — an independent risk layer for AI-driven trading in MetaTrader 5. AI agents (including MCP-connected agents since build 6060) trade at machine speed — and platform safety settings alone can't catch every mistake. AgentGuard watches every open position on a 5-second timer and enforces four hard limits: maximum total volume, maximum position count, mandatory stop-loss on every position, and a daily-loss circuit breaker that closes everything and latches until the next day. It works alongside any EA, manual trading, or AI agent — it doesn't care how a position was opened, only whether it violates a limit. Status panel, alerts on every intervention, monitor-only mode for safe calibration. Free. No DLLs. It manages risk — it never generates signals.

Manual Trade Pad for Strategy Tester Manual Trade Pad for Strategy Tester

A lightweight manual trading panel for MetaTrader 5 with market order execution, risk-based position sizing, Break-Even, partial close and position management. Works in both live trading and the Strategy Tester.

Portfolio Allocation Planner — budget-to-lots dashboard and CSV Portfolio Allocation Planner — budget-to-lots dashboard and CSV

Before configuring a basket, see which target weights fit your broker's minimum lots. Portfolio Allocation Planner turns an explicit hypothetical notional budget and percentages into a chart table: minimum-lot notional, lots rounded down, calculated allocation, target shortfall and row status. Recalculate on demand, inspect row tooltips, paginate longer lists, and optionally export the displayed snapshot to CSV. No trades are sent and no account balance, equity or positions are read.

MACD Signals MACD Signals

Indicator edition for new platform.