Ballast Trade Safety

The order handling behind every Ballast tool, as a library for your own Expert Advisors. One call opens a trade sized to a percentage of the account, refuses to send it without a stop, checks every broker limit first and retries requotes, so your EA never sends an order the broker or the Market validator rejects.

It is not a trading strategy. It is the part every EA needs and most get wrong: how many lots, is this order valid, what if the broker says no.

  • Lot size from risk that does not trust the broker's tick value alone. On CFDs priced in another currency the tick value can be far off (seen: Gold about 10% high, UK 100 16% low, Japan 225 175 times high). The library uses the terminal's own profit calculation, then contract size times exchange rate, and the tick value only as a last resort. Lots are always rounded down to the volume step.
  • Pre-trade checks with a reason in plain words: connection, Algo Trading, account and symbol permissions, trading session, volume (min, max, step), stop and target distance (stops level and freeze level), free margin, symbol volume limit.
  • Orders: market orders need a stop loss (an order without one is refused), prices are rounded to the tick size, the filling mode is chosen for the symbol, and requotes and price changes are retried up to 3 times at the new price. Modify stops, close all or part of a position.
  • Account protection: money lost if every stop is hit now (and how many positions have no stop), profit closed today, the balance when the day began, the room left before a daily loss limit and before a maximum loss limit, the way prop firms count them.

Example

#include <BallastTradeSafety.mqh>

void OnTick()
  {
   double sl = SymbolInfoDouble(_Symbol, SYMBOL_BID) - 300 * _Point;
   string why;
   ulong ticket = BT_OpenByRisk(_Symbol, true, sl, 0, 1.0, 123, "my EA", why);   // buy, risk 1% to the stop
   if(ticket == 0)
      Print("not opened: ", why);   // e.g. "not enough free margin", "market closed"
  }

Tested

  • Three two-month runs on real ticks through the import, as a buyer uses it: EURUSD with a USD account, Gold with a USD account, USDJPY with a EUR account. A test EA opened 396 trades sized to 0.5% risk, moved stops to break-even, closed halves, and tried 9 invalid orders on each run.
  • Lot size versus the terminal's own calculation: 0.0000% difference on every check. All 27 invalid orders refused with the right reason, 0 requests rejected by the broker in all three runs.
  • Loss of a stopped trade versus the planned risk (swap not included): worst 1.002x on Gold, 1.014x on USDJPY with a EUR account. On EURUSD some stops were filled further away during US news at 12:30 and the rollover (up to 2.1x the plan): no stop can prevent that slippage.

Notes

  • The Market installs the library in MQL5\Libraries\Market. The import line must match the file name there exactly (two backslashes in the path).
  • Risk is the move from the entry to the stop. Swap, commission and slippage are not included.
  • Days for the daily functions begin at the server hour you pass (0 = midnight server time). Deposits and withdrawals are not counted as profit.

All functions (copy this into MQL5\Include\BallastTradeSafety.mqh)

//+------------------------------------------------------------------+
//| BallastTradeSafety.mqh - import block for Ballast Trade Safety.  |
//| Save this file in MQL5\Include and add to your EA:              |
//|   #include <BallastTradeSafety.mqh>                              |
//| The Market installs the library in MQL5\Libraries\Market.        |
//+------------------------------------------------------------------+
#import "Market\\Ballast Trade Safety.ex5"
string BT_Version();
//--- money and sizing
double BT_LossPerLot(string symbol, double priceDistance);
double BT_NormalizeLots(string symbol, double lots);
double BT_NormalizePrice(string symbol, double price);
double BT_LotsForRisk(string symbol, double entry, double stop, double riskMoney);
double BT_LotsForRiskPercent(string symbol, double entry, double stop, double riskPercent);
//--- checks
bool   BT_CanTrade(string symbol, bool buy, string &reason);
double BT_MinStopDistance(string symbol);
bool   BT_StopsValid(string symbol, bool buy, double sl, double tp);
bool   BT_CheckOrder(string symbol, bool buy, double lots, double sl, double tp, string &reason);
//--- orders (a stop loss is required; requotes are retried)
ulong  BT_Open(string symbol, bool buy, double lots, double sl, double tp, ulong magic, string comment, string &reason);
ulong  BT_Buy(string symbol, double lots, double sl, double tp, ulong magic, string comment, string &reason);
ulong  BT_Sell(string symbol, double lots, double sl, double tp, ulong magic, string comment, string &reason);
ulong  BT_OpenByRisk(string symbol, bool buy, double sl, double tp, double riskPercent, ulong magic, string comment, string &reason);
bool   BT_SetStops(ulong position, double sl, double tp, string &reason);
bool   BT_Close(ulong position, double lots, string &reason);
//--- account protection
double BT_RiskToStops(string symbol, ulong magic, int &noStop);
double BT_TodayClosedProfit(int dayStartHour);
double BT_DayStartBalance(int dayStartHour);
double BT_DailyLossRoom(double limitPercent, double referenceBalance, int dayStartHour);
double BT_MaxLossRoom(double limitPercent, double baseBalance);
#import
Prodotti consigliati
Important: This product is a Library for developers . It is suitable only for users who can write/modify MQL5 code and integrate a compiled library into their own EA/Script. It is not a “drag & run” notifier. Telegram SDK helps you send Telegram messages and photos from MetaTrader 5 in a simple and reliable way. Use it when you want Telegram notifications inside your own automation tools. If you need the MetaTrader 4 version, it is available separately in the Market:   Telegram SDK M T4 . Main f
Introducing "TG Risk Service Manager" — your comprehensive toolkit for swift and precise risk management and lot size calculations in the dynamic world of trading. Designed to streamline development processes and enhance trading strategies, this indispensable library equips developers with essential tools for optimizing risk assessment and trade profitability. Metatrader4 Version |  All Products  |  Contact   Key Features: Efficient Lot Size Calculation : Harness the power of precise lot size c
The library is used to develop automatic trading on Binance Futures Market from MT5 platform. Support Binance Futures USD-M and COIN-M Support Testnet mode Support all order types: Limit, Market, StopLimit, StopMarket, StopLoss and TakeProfit Automatically display the chart on the screen Usage: 1. Open MQL5 demo account 2. Download Header file and EA sample https://drive.google.com/uc?export=download&id=17fWrZFeMZoSvH9-2iv4WDJhcyxG2eW17 Copy BinanceFutures.mqh to folder \MQL5\Include Copy  Bina
NATS (Niguru Automatic Trailing Stop) will help you achieve more profits, by setting the trailing stop automatically. Pair this NATS application with EA, or can also be used as a complement to manual trading. A trailing stop is a powerful tool in trading that combines risk management and profit optimization.  A trailing stop is a type of market order that sets a stop-loss at a percentage below the market price of an asset, rather than a fixed number. It dynamically adjusts as the asset’s pric
FREE
K Trade Lib5
Kaijun Wang
2 (1)
MT4/5通用交易库(  一份代码通用4和5 ) #import "K Trade Lib5.ex5"    //简单开单    long OrderOpen( int type, double volume, int magic, string symbol= "" , string comment= "" , double opprice= 0 , double sl= 0 , double tp= 0 , int expiration= 0 , bool slsetmode= false , bool tpsetmode= false );    //复杂开单    void SetMagic( int magic, int magic_plus= 0 ); void SetLotsAddMode(int mode=0,double lotsadd=0);    long OrderOpenAdvance( int mode, int type, double volume, int step, int magic, string symbol= "" , string comm
FREE
Equity Pulse MT5 Real-time equity, drawdown, and portfolio performance tracking in one clean trading panel. Equity Pulse MT5 is a practical account-monitoring indicator for MetaTrader 5. It helps traders see exactly where they stand across today, yesterday, recent days, the current week, month, and year. Instead of checking account history manually or relying only on the terminal’s floating profit number, Equity Pulse gives you a clear performance snapshot directly on the chart. It is designed
Ajuste BRA50
Claudio Rodrigues Alexandre
4.33 (6)
Este script marca no gráfico do ativo BRA50 da active trades o ponto de ajuste do contrato futuro do Mini Índice Brasileiro (WIN), ***ATENÇÃO***  para este script funcionar é necessário autorizar a URL da BMF Bovespa no Meta Trader. passo a passo: MetaTrader 5 -> Ferramentas -> Opções -> Expert Adivisors * Marque a opção "Relacione no quadro abaixo as URL que deseja permitir a função WebRequest" e no quadro abaixo adicione a URL: https://www2.bmf.com.br/ este indicador usa a seguinte página par
FREE
Binance Library
Hadil Mutaqin SE
5 (1)
The library is used to develop automatic trading on Binance Spot Market from MT5 platform. Support all order types: Limit, Market, StopLimit and StopMarket Support Testnet mode Automatically display the chart on the screen Usage: 1. Open MQL5 demo account 2. Download Header   file and EA sample   https://drive.google.com/uc?export=download&id=1kjUX7Hyy02EiwTLgVi8qdaCNvNzazjln Copy Binance.mqh to folder \MQL5\Include Copy  BinanceEA-Sample.mq5 to folder \MQL5\Experts 3. Allow WebRequest from MT5
T5L Library is necessary to use the EAs from TSU Investimentos, IAtrader and others. It contains all the functions framework needed to Expert Advisors working properly.  ツ - The Expert Advisors from  TSU Investimentos does not work without this library,  the T5L library can have updates during the year - At this Library you will find several funcionalities like order sends, buy and sell, trigger entry points check, candlestick analyses, supply and demmand marking and lines, and much more. 
DoIt EA Monitor MT5
Diego Arribas Lopez
DoIt EA Monitor - Multi EA Performance Dashboard for MT5 Your account can be profitable while one EA quietly drags down the portfolio. MetaTrader history shows the combined result, but it does not clearly show which strategy deserves more capital and which one needs attention. DoIt EA Monitor runs on one chart and separates live and historical performance by magic number, EA and symbol. It is completely read-only. It never opens, closes or modifies a trade. KNOW WHICH EA IS EARNING ITS PLACE Aut
FREE
MyTradingHistory
Max Timur Soenmez
Una libreria facile da usare che fornisce agli sviluppatori un accesso diretto alle principali statistiche di trading per i loro EA MQL5. Metodi disponibili dalla libreria: Dati del conto e profitti: GetAccountBalance() : Restituisce il saldo attuale del conto. GetProfit() : Restituisce il profitto netto da tutte le operazioni. GetDeposit() : Restituisce l'importo totale dei depositi. GetWithdrawal() : Restituisce l'importo totale dei prelievi. Analisi del trading: GetProfitTrades() : Restituisc
Liquidity Pool Heatmap – Dove aspettano gli stop: liquidità buy-side e sell-side come heatmap con profilo Liquidity Pool Heatmap mostra dove probabilmente si trovano gli ordini stop: sopra i massimi di swing (liquidità buy-side, BSL) e sotto i minimi di swing (liquidità sell-side, SSL). Ogni pool viene disegnato sul grafico come una linea di calore: più il pool è forte, più la linea è spessa e luminosa. Un profilo a destra mostra come la liquidità aperta si distribuisce sul prezzo. COSA VEDI
FREE
Static Text display
Muhammad Saad Khan
Visualizzazione di Testo Statico è un Expert Advisor (EA) leggero e facile da usare per MetaTrader 5, progettato per ispirare ed educare i trader mostrando suggerimenti di trading motivazionali direttamente sul tuo grafico. Con un elegante sfondo nero centrato e testo bianco in un font a spaziatura fissa, questo EA offre consigli concisi e pratici in frammenti rotanti per mantenerti concentrato su un trading disciplinato. Perfetto sia per i principianti che per i trader esperti, promuove princip
FREE
This is a simplified and effective version of the library for walk forward analysis of trading experts. It collects data about the expert's trade during the optimization process in the MetaTrader tester and stores them in intermediate files in the "MQL5\Files" directory. Then it uses these files to automatically build a cluster walk forward report and rolling walk forward reports that refine it (all of them in one HTML file). Using the WalkForwardBuilder MT5 auxiliary script allows building othe
Lo script UZFX - Close All Open Buy & Sell Orders Instantly per MetaTrader 5 (MT5) è un potente strumento che consente ai trader di chiudere immediatamente tutte le posizioni attive sul mercato con un'unica esecuzione. Questo script è ideale per la gestione delle operazioni di emergenza, aiutando i trader a uscire rapidamente dal mercato in caso di alta volatilità, eventi di cronaca o aggiustamenti della strategia. Caratteristiche: Chiude tutte le posizioni aperte di acquisto e vendita su tut
FREE
TradeGate
Alex Amuyunzu Raymond
TradeGate – Product Description / Brand Story “The gatekeeper for your trading success.” Overview: TradeGate is a professional MT5 validation and environment guard library designed for serious traders and EA developers who demand safety, reliability, and market-ready performance . In today’s fast-moving markets, even a small misconfiguration can cause EAs to fail initialization, skip trades, or be rejected by MQL5 Market. TradeGate acts as a smart gatekeeper , ensuring your EA only operates un
OrderHelper MT5
Md Atikur Rahman
OrderHelper script is super easy and trader friendly to use. It would boost your trading experience. Because it is designed to open one to multiple orders quickly with just one click. Besides using the OrderHelper script, traders can define various parameters for open orders such as the symbol, order type, lot size, stoploss, takeprofit and more. Basically, with this script traders can manage their open orders more efficiently and save their trading time. OrderHelper manages: Open the number of
BitMEX Trading API
Romeu Bertho
5 (1)
Cryptocurrency analysis has never been easier with Crypto Charts for MetaTrader 5. Now, trading on BitMEX has never been easier with BitMEX Trading API for MetaTrader 5. BitMEX Trading API library was built to be as easy to use as possible. Just include the library into your Expert Advisor or Script, call the corresponding methods and start trading! Features Trade on BitMEX and BitMEX Testnet. Build and automate your strategies. Concern more with the trading strategy logic and less with the co
Delete Only Pending Orders
Muhammad Usman Siddique
Lo script UZFX - Delete Only Pending Orders per MetaTrader 5 (MT5) è uno strumento semplice ma efficace che rimuove automaticamente tutti gli ordini in sospeso (Buy Limit, Sell Limit, Buy Stop, Sell Stop) dal conto di trading. Questo script è ideale per i trader che desiderano cancellare istantaneamente gli ordini in sospeso senza influenzare le posizioni attive sul mercato. Scopri tutti i miei altri indicatori ed EA per MT4/MT5 >> QUI Caratteristiche: Cancella tutti gli ordini pendenti (Buy
FREE
Lib5 EAPadPRO for MT5
Vladislav Andruschenko
4.5 (6)
EAPADPRO Library for MetaTrader 5 è una libreria professionale gratuita di interfaccia per aggiungere un pannello informativo moderno al tuo Expert Advisor. La libreria è pensata per sviluppatori MQL5 che vogliono dare ai propri programmi di trading una presentazione visiva più pulita, più informativa e più professionale direttamente sul grafico di MetaTrader 5. Gli Expert Advisors per MetaTrader 5 spesso contengono logiche più complesse, molte impostazioni, filtri per Magic number, regole di es
FREE
SMC Structure Markup
Seyed Mohammad Hosseini Hejazi
4.69 (16)
Overview The Smart Money Structure Markup Indicator for MetaTrader 5 is a powerful tool designed to help traders identify key market structures based on popular Smart Money Concepts (SMC) strategies. This indicator detects micro-market structures, providing insights into price movements and potential trend changes. It highlights important elements such as valid Break of Structure (BOS), Change of Character (CHoCH), and Inducement (IDM), helping traders to make informed decisions. Key Features Ma
FREE
News Clock
Victor Klenov
The professional browser of News and Trading Sessions is now available in MetaTrader 5. Now all the most important market information is collected on one dial! News located on the Time scale. Planning your working time has never been so easy and convenient ... The news scale can be switched a day, two, a week, a month forward or backward (see the details in the short video). All news updates in real time. Thanks to the built-in filters, you can configure the display of news by importance, cou
Nexus Quant Matrix
Syarief Azman Bin Rosli
Nexus Quant Matrix MT5 Nexus Quant Matrix   è una libreria di calcolo quantitativo e analisi statistica in streaming di livello istituzionale, sviluppata nativamente per MetaTrader 5. Progettata per sviluppatori quantitativi, hedge fund sistematici e architetti di algoritmi, Nexus Quant Matrix garantisce un'elaborazione numerica ad alte prestazioni direttamente nell'ambiente MQL5 senza necessità di DLL esterne, Python o moduli C++. Operando con complessità computazionale O(1), la libreria gestis
Goliath Mt5
Nicolokondwani Biscaldi
Goliath MT5 - scalper fully automated Expert Advisor for medium-volatile forex markets P roperties: The Library trades 10 currency pairs (USDCHF, EURCHF, EURGBP, AUDUSD, USDCAD, GBPUSD, EURUSD, NZDUSD, CADCHF, EURAUD, EURCAD, AUDJPY) The Library does not use martingale The Library sets a fixed stop loss and take profit for all orders The Library only trades a user input volume The Library can be installed on any currency pair and any timeframe Recommendations: Before using on a real account, t
Smetti di indovinare. Inizia a fare trading con un vantaggio statistico. Gli indici azionari non si negoziano come il forex. Hanno sessioni definite, gap notturni e seguono pattern statistici prevedibili. Questo indicatore ti fornisce i dati di probabilità di cui hai bisogno per fare trading su indici come DAX, S&P 500 e Dow Jones con fiducia. Cosa lo rende diverso La maggior parte degli indicatori ti mostra cosa è successo. Questo ti mostra cosa probabilmente succederà dopo. Ogni giorno di trad
Crystal FVG Touch Detector – Indicatore professionale Smart Money Crystal FVG Touch Detector è un indicatore avanzato per trader che utilizzano i concetti Smart Money (SMC) e ICT. Rileva automaticamente i Fair Value Gaps (FVG) su ogni timeframe e li mostra con colori e rilevamento dei tocchi. Basato su logica non-repaint, consente di individuare in tempo reale le zone di squilibrio istituzionale. Caratteristiche principali Identificazione precisa FVG rialzisti e ribassisti. Aggiornamento immedia
FREE
LSTM Library
Thalles Nascimento De Carvalho
LSTM Library - Reti Neurali Avanzate per MetaTrader 5 Libreria Professionale di Reti Neurali per il Trading Algoritmico LSTM Library porta la potenza delle reti neurali ricorrenti alle tue strategie di trading in MQL5. Questa implementazione di livello professionale include reti LSTM, BiLSTM e GRU con funzionalità avanzate tipicamente disponibili solo in framework specializzati di machine learning. "Il segreto del successo nel Machine Learning per il trading risiede nel trattamento adeguato dei
Adaptive RSI-OsMA-STO   is an advanced market intelligence tool designed to detect price momentum and high-probability reversal points with absolute precision. By unifying three of the market's most powerful oscillators, this indicator provides dynamic divergence visualization without cluttering your chart workspace. Key Features Triple-Oscillator Confluence:   Seamlessly combines Adaptive RSI, Stochastic, and OsMA into a single integrated panel. This system filters out false signals by cross-re
Shawrie
Kevin Kipkoech
This Pine Script implements a Gaussian Channel + Stochastic RSI Strategy for TradingView . It calculates a Gaussian Weighted Moving Average (GWMA) and its standard deviation to form an upper and lower channel. A Stochastic RSI is also computed to determine momentum. A long position is entered when the price closes above the upper Gaussian band and the Stoch RSI K-line crosses above D-line . The position is exited when the price falls back below the upper band. The script includes commission, cap
Teclado trader, é uma BIBLIOTECA que você pode chamar no OnChartEvent para abrir posição de compra/venda/zerar, os botões padrões são: V = venda C = compra Z = zerar posições a mercado S = zerar posições opostas e depois a mercado X = zerar posições opostas Além da função de teclado, é possível mostrar os estados do ExpertAdvisor usando o MagicId, com informação de: lucro mensal, semanal, diario, e posição aberta, para isto use o OnTick, ou qualquer outro evento (OnTimer / OnTrade / OnBookEven
Gli utenti di questo prodotto hanno anche acquistato
XAUUSD BREAKOUT EA — Stop Predicting the Market. Trade the Breakout. You do not need to sit in front of the chart all day waiting for gold to break support or resistance. This XAUUSD Breakout EA is designed to identify market consolidation, detect meaningful price expansion, and automatically execute trades when predefined breakout conditions are met. BACKTEST RESULTS — 99% QUALITY Initial Deposit: $1,000 Total Net Profit: +$21,115 Profit Factor: 2.37 Expected Payoff: $213 per trade Total Tr
ModernUI Library
Levi Dane Benjamin
Libreria ModernUI per MetaTrader 5 ModernUI è una libreria di interfaccia utente ospitata sul grafico per MetaTrader 5. Aiuta gli sviluppatori MQL5 a creare pannelli EA più puliti, dashboard, finestre di impostazioni, form, tabelle, finestre di dialogo, drawer e interfacce compatte in stile trading direttamente nell’ambiente grafico di MT5. È progettata per gli sviluppatori che vogliono un livello di interfaccia più professionale rispetto a oggetti grafici sparsi, mantenendo comunque il pieno co
Native Websocket
Racheal Samson
5 (6)
An   easy to use, fast,  asynchronous   WebSocket library  for MQL5. It supports: ws://   and   wss://  (Secure "TLS" WebSocket) text   and   binary   data It handles: fragmented message  automatically (large data transfer) ping-pong   frames  automatically (keep-alive handshake) Benefits: No DLL required. No OpenSSL installation required. Up to 128 Web Socket Connections from a single program. Various Log Levels for error tracing Can be synchronized to MQL5 Virtual Hosting . Completely native t
This library will allow you to send your trades using your MT5 EA bot and its very easy to integrate on any EA which you can do yourself with the script code which is mentioned in documentation. This product allows trading operations via API For MEXC chart : Renting   Crypto Charting  for OHLC data or   Crypto Ticks with Order Book Depth  is optional - Supports MEXC API calls - Place Limit, SL Limit and Take Profit Limit Orders - Place Market, SL-Market, TP-Market orders - Modify Limit order - C
MT5 to Delta Exchange API Bridge EA Connector allows your expert advisor with mq5 file to integrate and communicate with Delta Exchange using API Keys You can place order, check balance and other order managements using Delta Exchange API - Place Limit, SL Limit and Take Profit Limit Orders - Place Market, SL-Market, TP-Market orders - Cancel Order - Query Orders - Change Leverage, margin - Get Position info and many more, details available at demo script Script Documentation 
The library is dedicated to help manage your trades, calculate lot, trailing, partial close and other functions. Lot Calculation Mode 0: Fixed Lot. Mode 1: Martingale Lot (1,3,5,8,13) you can use it in different way calculate when loss=1 ,when profit=0. Mode 2: Multiplier Lot (1,2,4,8,16) you can use it in different way calculate when loss=1 ,when profit=0. Mode 3: Plus Lot (1,2,3,4,5) you can use it in different way calculate when loss=1 ,when profit=0. Mode 4: SL/Risk Lot calculate based on s
Friends, join us! Ask questions and connect with like-minded traders: MetaCOT Public Group MetaCOT Information Channel: news, CFTC reports, and signals: MetaCOT Channel Here’s to successful trading and new profitable signals for us all! Attention! Recently, certain countries have been blocking access to the cftc.gov website. As a result, users in these countries are giving the product low ratings. MetaCOT has always adhered to the highest quality standards and is in no way associated with th
WalkForwardOptimizer MT5
Stanislav Korotky
3.63 (8)
WalkForwardOptimizer library allows you to perform rolling and cluster walk-forward optimization of expert advisers (EA) in MetaTrader 5. To use the library include its header file WalkForwardOptimizer.mqh into your EA source code, add call provided functions as appropriate. Once the library is embedded into EA, you may start optimization according to the procedure described in the User guide . When it's finished, intermediate results are saved into a CSV file and some special global variables.
OrderBook History Library
Stanislav Korotky
3 (2)
Order Book, known also as Market Book, market depth, Level 2, - is a dynamically updated table with current volumes of orders to buy and to sell specific financial instument at price levels near Bid and Ask. MetaTrader 5 provides the means for receiving market book from your broker, but in real time only, without access to its history. The library OrderBook History Library reads market book state in the past from archive files, created by OrderBook Recorder . The library can be embedded into you
Gold plucking machine   Gold plucking machine is an Expert Advisor designed specifically for trading gold. The operation is based on opening orders using the Fast and Slow lines indicator, thus the EA works according to the "Trend Follow" strategy, which means following the trend. Use grid strategy to place orders without stop loss operation, so please make sure the account has sufficient funds. magic number      -  is a special number that the EA assigns to its orders. Lot Multiplier        - 
MT4/5通用交易库(  一份代码通用4和5 ) #ifdef __MQL5__      #define KOD_TICKET ulong      #define KOD_MAGIC   long #else        #define KOD_TICKET long      #define KOD_MAGIC   int #endif class ODLIST; #import "K Trade Lib Pro 5.ex5"       //祝有个美好开始,运行首行加入    void StartGood() ;    //简单开单    long OrderOpen( int type, double volume, int magic, string symbol= "" , string comment= "" , double opprice= 0 , double sl= 0 , double tp= 0 , int expiration= 0 , bool slsetmode= false , bool tpsetmode= false );    //复杂开单
Binance Library MetaTrader 5 connects your Expert Advisors, indicators, and scripts to Binance.com and Binance.US directly from MetaTrader 5. It is a developer library for building custom Binance integrations inside MT5, not a standalone trading robot or copier. The library helps you add Binance instruments to Market Watch, read symbol specifications, load current and historical market data, check wallet balances, manage orders, and track open positions. It supports Spot, USD-M futures, and COI
1. What is this The MT5 system comes with very few optimization results. Sometimes we need to study more results. This library allows you to output more results during backtest optimization. It also supports printing more strategy results in a single backtest. 2. Product Features The results of the optimized output are quite numerous. CustomMax can be customized. The output is in the Common folder. It is automatically named according to the name of the EA, and the name of the same EA will be au
AO Core
Andrey Dik
3.67 (3)
AO Core is the core of the optimization algorithm, it is a library built on the author's HMA (hybrid metaheuristic algorithm) algorithm. Pay attention to the MT5 Optimization Booster product , which makes it very easy to manage the regular MT5 optimizer . An example of using AO Core is described in the article: https://www.mql5.com/ru/articles/14183 https://www.mql5.com/en/blogs/post/756510 This hybrid algorithm is based on a genetic algorithm and contains the best qualities and properties of p
EA Toolkit
Esteban Thevenon
EA Toolkit   is a library that allows any developer to quickly and easily program Advisor experts. It includes many functions and enumerations such as trailing stop, lot, stop loss management, market trading authorisations, price table updates, trading conditions and many more. Installation + Documentation : You will find all the information to install this library and the documentation of its functions on this GitHub : https://github.com/Venon282/Expert-Advisor-Toolkit WARNING : The installat
Questa libreria ti consentirà di gestire le operazioni utilizzando qualsiasi tuo EA ed è molto facile da integrare su qualsiasi EA, cosa che puoi fare tu stesso con il codice script menzionato nella descrizione e anche esempi demo su video che mostrano il processo completo. - Ordini con limite di posizionamento, limite SL e limite di take profit - Ordini di mercato, mercato SL, mercato TP - Modifica ordine limite - Annulla Ordine - Interroga gli ordini - Cambia leva, margine - Ottieni inf
Hello everyone! I am a professional MQL programmer , Making EAs, Indicators and Trading Tools for my clients all over the world. I build 3-7 programs every week but I seldomly sell any ready-made Robots. Because I am fastidious and good strategy is so few...  this EA is the only one so far I think its good enough to be published here.  As we all know, the Ichimoku indicator has become world popular for decades, but still, only few people knows the right way of using it, and if we check the clo
Applying these methods, I managed to arrive at a nuanced conclusion that is crucial to understanding the importance of unique strategies in contemporary trading. Although the neural network advisor showed impressive efficiency in the initial stages, it proved to be highly unstable in the long run. Various factors such as market fluctuations, trend changes, external events, etc. cause its operation to be chaotic and eventually lead to instability. With these experiences, I accepted the challenge
Introducing "TG Trade Service Manager" — your all-in-one solution for seamless trade management in both MQL4 and MQL5 environments. With a focus on speed, reliability, and convenience, this powerful library simplifies the complexities of trade execution and management, empowering developers with a single interface for enhanced efficiency. Metatrader4 Version   |   All Products   |   Contact   Key Features: Unified Interface : TG Trade Service Manager" provides a unified interface for   MQL4   an
OpenAI Library MT5
VitalDefender Inc.
La seguente libreria si propone come un mezzo per poter utilizzare le API di OpenAI direttamente sulla metatrader, nella maniera più semplice possibile. Per maggiori approfondimenti sulle potenzialità della libreria, leggere il seguente articolo: https://www.mql5.com/it/blogs/post/756106 I file necessari per usare la libreria li trovate qui: Manuale IMPORTANTE: Per utilizzare l'EA è necessario aggiungere il seguente URL per consentire l'accesso all'API OpenAI c ome mostrato nelle immagini allega
KP TRADE PANEL EA is an EA MT5 facilitates various menus. KP TRADE PANEL EA is an EA skin care in MT5 is an EA that puts the system automatically in download EA MT5 to test with demo account from my profile page while some Trailing Stop Stop Loss require more than 0 features EA determines lot or money management calculates lot from known and Stop loss TS = Trailing stop with separate stop loss order Buy more AVR TS = Trailing stop plus
Here   is   the   English translation   of   your   description   for   the EA   (Expert   Advisor): --- This   is a   time -based   automatic trading   EA . It allows   you   to   set the   exact   time   for trading , down   to   the   second , and   specify the   maximum number   of   orders . You   can choose   to   place   either   buy   or   sell   orders . It   is possible to   set take   profit and   stop   loss   points . Additionally , you can   specify   how   long after   placing  
Molo kumalo
James Ngunyi Githemo
Trading Forex with our platform offers several key advantages and features: Real-time Data : Stay updated with live market data to make informed decisions. User-Friendly Interface : Easy-to-navigate design for both beginners and experienced traders. Advanced Charting Tools : Visualize trends with interactive charts and technical indicators. Risk Management : Set stop-loss and take-profit levels to manage your risk. Multiple Currency Pairs : Access a wide range of forex pairs to diversify your tr
Kaseki
Ben Mati Mulatya
The Hybrid Metaheuristic Algorithm (HMA) is a cutting-edge optimization approach that combines the strengths of genetic algorithms with the best features of population-based algorithms. Its high-speed computation ensures unparalleled accuracy and efficient search capabilities, significantly reducing the total time required for optimization while identifying optimal solutions in fewer iterations. HMA outperforms all known population optimization algorithms in both speed and accuracy. Use Cases AO
*****La negoziazione principale è XAUUSD. In caso di test, si consiglia di adeguarsi a XAUUSD. Altri obiettivi di trading non possono garantire la redditività******* Se avete bisogno di testare, lasciate un messaggio (vi risponderò non appena lo vedo). Per proteggere i risultati del lavoro, è necessario inserire parametri specifici. I parametri predefiniti del sistema non possono raggiungere l'effetto mostrato nel pullback dello screenshot! Se avete bisogno di testare, lasciate un messaggio (
Questo prodotto è in sviluppo da 3 anni. È il codice più avanzato per lavorare con tutti i tipi di intelligenza artificiale e apprendimento automatico nel linguaggio di programmazione MQL5. È stato utilizzato per creare molti robot di trading e indicatori basati sull'IA in MetaTrader 5. Questa è una versione premium del progetto open source e gratuito per il machine learning in MQL5, disponibile qui:  https://github.com/MegaJoctan/MALE5 . La versione gratuita ha meno funzionalità, è meno documen
Bookeepr
Marvellous Peace Kiragu
Bookeepr is an advanced MQL5 trading bookkeeping software that automates trade logging, tracks real-time P&L, and integrates a ledger-style financial system for deposits, withdrawals, and expenses. It supports multi-currency assets , generates detailed performance reports , and provides risk management tools to help traders optimize their strategies. With secure cloud storage, exportable reports, and seamless MetaTrader 5 integration , Bookeepr ensures accurate, transparent, and hassle-free fina
Ai Prediction MT5
Mochamad Alwy Fauzi
A free indicator for those who purchase the full version This indicator is created by this Ai, with your desired settings Artificial Intelligence at your service Have a complete artificial intelligence and use it in your codes This artificial intelligence is trained to tell you on each candle whether the market is moving up or down. In general, artificial intelligence can be used in all markets, all timeframes and all symbols However, due to the increasing complexity and decreasing accuracy of
快速关仓,无需任何操作。 当前版本的一键关仓主要针对的是来不及手动关仓的情况,目前是不分交易标的类别,是对所有的持仓进行关仓。 未来可能升级的方向: 1、分类别、分标的关仓。 适用场景:开了多个标的的仓位,并且波动不一,快速频繁的波动影响了整体的判断。 2、增加只关闭盈利仓位、只关闭亏损仓位。 适用场景:持仓较多,趋势发生变化。 个人建议:一般建议选择一键全部关仓,因为如果行情与持仓方向一致,只关闭盈利仓位无形就是扩大了亏损。如果行情方向与持仓方向相反,只关闭亏损仓位,当前已盈利的后面又会变为亏损,盈利无法变现。 3、按照仓位顺序由大到小关仓、按照仓位顺序由小到大关仓。 适用 场景:行情发生波动,对于未来行情判断把握不确定的,可根据自己需求选择仓位关仓顺序,由大到小关仓的话,可以避免亏损的进一步扩大。 4、减小仓位量,保持绝对的安全距离。 适用 场景:对未来趋势相对确定,不想错过当前行情,但是认为当前持仓体量又有点大,想降低仓位。
License Manager EA
Timothy Chuma Ifiora
License Panel Integration Guide This EA uses a license panel system to verify usage before running trading logic. File Placement Place LICENSE_SINGLE.mqh in the same folder as your EA .mq5 file. If using a subfolder, update the #include path in the EA file. Integration Steps Include the License File #include "LICENSE_SINGLE.mqh" Initialization (OnInit) Call the license check when the EA starts: VerifyLicense(); Deinitialization (OnDeinit) Clean up license resources when EA is removed: HandleLi
Altri dall’autore
Free. What does trading really cost at your broker, hour by hour? Ballast Spread Log measures the spread tick by tick, keeps a log for every weekday hour and shows on the chart when trading is cheap and when it is expensive. It never trades. 24 bars, one per hour (server time): the average spread from Monday to Friday or only for today's weekday. Green = normal, orange = above 1.5x typical, red = above 3x typical. Time weighted : a spread that lasts 30 seconds counts 30 times more than one that
FREE
Free lot size calculator (position size calculator) with stop-loss and take-profit levels from the average daily range (ADR): the lot is rounded down, so the stop risks no more than your chosen % of balance (before slippage and commission). Ballast Risk Panel opens trades in one click with the lot from your risk % and an automatic stop. It sizes that stop its own way (ATR or fixed points), so its lot differs from the one shown here. For prop-firm accounts, Ballast Prop Guard fits the stops of al
FREE
Free lot size calculator (position size calculator) with stop-loss and take-profit levels from the average daily range (ADR): the lot is rounded down, so the stop risks no more than your chosen % of balance (before slippage and commission). Ballast Risk Panel opens trades in one click with the lot from your risk % and an automatic stop. It sizes that stop its own way (ATR or fixed points), so its lot differs from the one shown here. For prop-firm accounts, Ballast Prop Guard fits the stops of al
FREE
Would your trading have passed a prop-firm challenge? Checks your closed trades against the daily loss, max loss, profit target and minimum trading days, and shows every day that broke a rule. Drop Ballast Prop Rules Checker on any chart, enter the rules of your firm, and in a second it replays your account history day by day the way a prop firm judges it: Verdict: PASSED, FAILED (which rule, on which day and hour), or still running. Daily loss limit: how many days broke it and how many came wit
FREE
Free. What does trading really cost at your broker, hour by hour? Ballast Spread Log measures the spread tick by tick, keeps a log for every weekday hour and shows on the chart when trading is cheap and when it is expensive. It never trades. 24 bars, one per hour (server time): the average spread from Monday to Friday or only for today's weekday. Green = normal, orange = above 1.5x typical, red = above 3x typical. Time weighted : a spread that lasts 30 seconds counts 30 times more than one that
FREE
Shows where your account loses money: trades without a stop-loss, worst symbols, weekdays, hours and holding times. New in 1.10: the report ends with What would have helped — for each problem it found (trades without a stop, a few oversized losses, one very bad day) it names the fix and the Ballast tool that does it: Ballast Risk Panel (lot from risk, a stop on every trade, daily loss lock) or Ballast Prop Guard (prop-firm rules). Drop Ballast Loss Finder on any chart. In a second it reads your
FREE
Shows where your account loses money: trades without a stop-loss, worst symbols, weekdays, hours and holding times. New in 1.10: the report ends with What would have helped — for each problem it found (trades without a stop, a few oversized losses, one very bad day) it names the fix and the Ballast tool that does it: Ballast Risk Panel (lot from risk, a stop on every trade, daily loss lock) or Ballast Prop Guard (prop-firm rules). Drop Ballast Loss Finder on any chart. In a second it reads your
FREE
Would your trading have passed a prop-firm challenge? Checks your closed trades against the daily loss, max loss, profit target and minimum trading days, and shows every day that broke a rule. Drop Ballast Prop Rules Checker on any chart, enter the rules of your firm, and in a second it replays your account history day by day the way a prop firm judges it: Verdict: PASSED, FAILED (which rule, on which day and hour), or still running. Daily loss limit: how many days broke it and how many came wit
FREE
Direct translation of blackcat's L3 Banker Fund Flow Trend Oscillator. Get push notifications on your phone app when a signal bar has formed. Historical signals are shown with buy/sell arrow right on the main chart. Indicator uses two data calculations to check for a cross below 25% level (a signal to go long) and above 75% level (a signal to short). For any further questions  feel free to contact me directly. Including requests for product improvements.
Two lines are being drawn in a separate window. And both are representing an angle of a trendline. One trendline is measured going across two price highs, but the other is measured across two lows. You get to choose the period from which the first price high and first price low is being determined. The second high and low comes from identical time period preceding the first one. Feel free to experiment with the period count until you get the confirmation you are looking for.
Line1: simple calculation of change in closing price for the chosen input period - named Velocity. Line2: simple calculation of change in velocity for the chosen input period - named Acceleration. Feel free to play with the input periods to find a profitable combination. For faster results it is best to do it in MT Optimizer. Can assist in either manual or automatic trading.
This is an Expert that gives you a control panel with two buttons - 'Hide Stops' and 'Show Stops'. With a click of a button you can hide your stoploss and takeprofit levels from your broker and restore them if necessary. When levels are hidden Expert tracks orders in the background and closes them as soon as the price exceeds hidden levels. It is not opening new orders just working with existing ones, only stoploss and takeprofit levels are not visible to the market. Choose zero as magic number
Keeps your prop-firm challenge inside its rules: fits every stop to the loss you have left, closes and locks before the daily or total limit, locks a reached profit target. Launch price until 3 December 2026: 35 USD (then 49 USD). A prop-firm challenge is usually lost to one rule: the maximum daily loss or the maximum total loss. Ballast Prop Guard watches the whole account — manual trades and every EA — and makes those limits very hard to break. What it does Fitted stops — every open trade gets
One-click trading that sizes every lot from your risk %, adds a stop-loss to any trade without one, and locks trading after your daily loss limit. Most accounts are not lost by a bad strategy. They are lost by one trade without a stop, one oversized lot, or one bad day that turns into revenge trading. Ballast Risk Panel stops all three. 1. Buy / Sell with the right lot size Press BUY or SELL. Ballast Risk Panel calculates the lot so that the stop-loss loses exactly your chosen % of balance (defa
Manages your open trades for you: break-even, partial profit, ATR trailing stop and time exit — measured in R, never loosening a stop. Opening a trade is the easy part. Ballast Exit Manager handles the rest, the same way every time, for manual trades and trades from other EAs. Everything is measured in R = the trade's initial risk (the distance from entry to the first stop-loss). A trade at +1R has made as much as it risked. Break-even — at +1R (default) the stop moves to the entry price plus a
Closes all your trades together when their combined profit or loss reaches your target — in money or % of balance — with an optional trailing profit lock. Many trades open at once — from you, from several EAs, or a grid/basket strategy. Ballast Equity Target watches their combined result and closes them all together: Profit target in money and/or % of balance (the first one reached wins). Loss limit in money and/or % of balance. Trailing profit lock — once the basket is up X%, it may give back a
Hidden stop-loss and take-profit: your levels stay in the EA, not at the broker. Drag the lines to move them; a wider emergency stop stays as insurance. Ballast Stealth Stops keeps your stop-loss and take-profit inside the EA. When price reaches a level, the trade is closed at market. The broker sees only a much wider emergency stop (or nothing, if you choose). Takes over existing broker stops/targets, or sets hidden levels (fixed points or ATR multiple, target as a multiple of the stop). Drag t
One-cancels-other for MT4: when one pending order fills, the others are deleted at once. One-click straddle with stop, target, expiry and a risk-based lot. MetaTrader 4 has no built-in OCO. Place a buy stop above and a sell stop below before the news, one of them fills, and the other one is still waiting to open a second trade against you. Ballast OCO Orders deletes it for you. What it does OCO for any pending orders — buy/sell stop, buy/sell limit. Placed by hand, from the one-click button, or
One line at the price where all your open trades on the symbol together are at zero — swaps and commission included — plus lines for your basket profit target and loss limit. Three buys at different prices, one sell, a few EAs on the same chart: where is the price at which all of it together is back at zero? MT4 does not show it. Ballast Break Even draws that price as one line and keeps it up to date on every tick. What it shows Break-even line — the Bid price at which all open trades on the sym
Asia, London and New York session boxes, with statistics from the symbol's own history: average ranges, how often London breaks the Asian range, when the day's high and low form. Session boxes show where each session traded. Ballast Session Ranges also tells you what usually happens next on the symbol you are looking at, measured on its own history. On the chart Boxes for the Asian, London and New York sessions, with the range of each session in points. Session hours are inputs (server time), in
Shows what your open trades really add up to: net long/short per currency, index and metal exposure, and the money lost if every stop is hit. Buy EURUSD, buy EURJPY, buy USDJPY — three different trades? Not really: you are long EUR twice and short JPY twice. Ballast Exposure Meter adds up every open trade on the account and shows the real picture. Net exposure per currency — long or short, the amount in that currency and its value in your account currency, largest first. Indices, metals, stocks,
Your account on your phone: push notifications for equity drops, low margin, trades without a stop, AutoTrading switched off, lost connection, every trade and a daily summary. Running EAs on a VPS, or leaving a manual trade open while you are away? Ballast Account Alerts watches the whole account and tells your phone (MetaTrader mobile app push), the terminal (alert) or your e-mail. Alarms Equity down X% since the start of the day (default 5%), or below a fixed amount. Margin level below X% (def
Averaging grid with a worst case you know before you start: a real broker stop on every trade, lots sized so all levels filled plus the stop = your chosen % of balance. Launch price until 3 December 2026: 35 USD (then 49 USD). Averaging grids win often and lose rarely, but when they lose, many accounts are gone. The cause is almost always the same: no stop, and lots that grow until the margin runs out. Ballast Grid Manager keeps the useful part of a grid and removes the unlimited part. How it wo
Copies trades between MT4 terminals on one PC or VPS — opens, partial closes, closes, stop-loss and take-profit — and to or from the MT5 version. Launch price until 3 December 2026: 41 USD (then 59 USD). Run TradeCopier as MASTER on the account you trade, and as SLAVE on every account that should follow. All terminals must run on the same computer or VPS. Copies new trades, partial closes , full closes, stop-loss and take-profit changes . MT4 and MT5 together: the MT4 and MT5 versions use the sa
Your trading in R: every closed trade divided by the money its stop risked. See which setups really pay, what a trade is worth on average and how your weeks went, without keeping a spreadsheet. Attach Ballast Trade Journal to any chart. It reads the account history, rebuilds every trade (partial closes and additions included) and refreshes by itself each time a trade closes. It never opens, changes or closes a trade. R for every trade : the result (with swap and commission) divided by the money
Stop losing trades to the spread. At rollover and around news the spread can jump to ten or twenty times its usual size for a minute: pending orders fill at bad prices and stop-losses get hit although the price never went there. Ballast Spread Guard steps aside while the spread is wide and puts everything back when it is normal again. Attach it to one chart. It watches the spread of that symbol (or a list of symbols) and acts on all their orders, manual or from any EA. It never opens a trade. Kn
The order handling behind every Ballast tool, as a library for your own Expert Advisors. One call opens a trade sized to a percentage of the account, refuses to send it without a stop, checks every broker limit first and retries requotes, so your EA never sends an order the broker or the Market validator rejects. It is not a trading strategy. It is the part every EA needs and most get wrong: how many lots, is this order valid, what if the broker says no. Lot size from risk that does not trust th
The prop-firm rules behind Ballast Prop Guard, as a library for your own Expert Advisors. Give it the firm's rules once. On every tick it tells your EA whether it may trade and how many lots still fit before the daily or total loss limit, and it tightens stops so that all open trades together cannot take the account past a limit. It is not a trading strategy. It is the part a prop-firm EA needs and that ends most challenges: one bad day, or one trade too big. The rules firms use : daily loss mea
Pauses the Expert Advisors on your other charts when trading is a bad idea, and restarts them afterwards with their own settings: after a daily loss or a run of losing trades, at the hours you choose, or while the spread is too wide. One copy on one chart looks after all the others. Any EA works as it is: no code changes, no DLL, no web requests. How a pause works : EA Pause saves the chart's template, takes the EA off the chart and keeps everything else (indicators, drawings, settings). While p
A backtest with a smooth curve and a 90% win rate can hide a martingale, a grid without a stop, or a drawdown the balance line never shows. Ballast EA XRay reads the trades and tells you, in plain words, the risk an Expert Advisor hides - before you trust it with money. Works on a Strategy Tester report (MT5 or MT4, saved as HTML) - also of the free demo of any EA from the Market - or on this account's own history, filtered by magic number. It is a script: it never trades and changes nothing. Wh
Filtro:
Nessuna recensione
Rispondi alla recensione