BitMEX Trading API

5

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 code.

Automate your alerts and don't lose trading opportunities anymore!

Create custom Trade Pads for manual trading.

Build Hybrid strategies by mixing manual and automated trading.

Code whatever you want by using MQL5 language + BitMEX Trading API.

Create your strategy, go for BitMEX Testnet, then move for real trading!

Getting Started

All the required files and example codes can be found in the CodeBase. To use BitMEX Trading API and run all the example codes, you must download all the files and install them in their corresponding folders.  


Methods Description
void SetAccount(string apiKey, string apiSecret, bool testnet) Set your BitMEX account to trade. By default, API Keys can only read basic user data, such as positions, margin, orders, and executions. They cannot submit orders or withdraw.If you wish to execute orders with your API Key, you must add the "order" permission upon creation.
bool Order(ENUM_BITMEX_REST_METHOD method, MqlBitmexOrderRequest &request, MqlBitmexOrderResult &result[]) Create a new order, get pending orders and order history, amend the quantity or price of a pending order, cancel orders.
bool OrderBulk(ENUM_BITMEX_REST_METHOD method, MqlBitmexOrderRequest &request[], MqlBitmexOrderResult &result[]) Create and amend multiple orders for the same symbol.
bool OrderCancelAllAfter(ENUM_BITMEX_REST_METHOD method, MqlBitmexOrderRequest &request, MqlBitmexOrderResult &result[]) Automatically cancel all your orders after a specified timeout.
bool OrderAll(ENUM_BITMEX_REST_METHOD method, MqlBitmexOrderRequest &request, MqlBitmexOrderResult &result[]) Cancel all of your orders.
bool Position(ENUM_BITMEX_REST_METHOD method, MqlBitmexPositionRequest &request, MqlBitmexPositionResult &result[]) Get your position status.
bool PositionIsolate(string symbol, bool enabled, MqlBitmexPositionResult &result[]) Enable isolate margin or cross margin per-position.
bool PositionLeverage(string symbol, double leverage, MqlBitmexPositionResult &result[]) Choose leverage for a position.
bool PositionRiskLimit(string symbol, double riskLimit, MqlBitmexPositionResult &result[]) Update your risk limit.
bool PositionTransferMargin(string symbol, double amount, MqlBitmexPositionResult &result[]) Transfer equity in or out of a position.
bool UserMargin(string currency, MqlBitmexUserMarginResult &result[]) Get your account's margin status.
bool Execution(MqlBitmexExecutionRequest &request, MqlBitmexExecutionResult &result[]) Get all raw executions for your account.
bool OrderBook(string symbol, int depth, MqlBookInfo &orderBook[]); Get level 2 orderbook data.
bool IntrumentCompositeIndex(MqlBitmexInstrumentRequest &request, MqlBitmexInstrumentCompositeIndex &result[]); Show constituent parts of an index.
void GetRateLimit(int &limit, int &remaining, long &reset); Get the rate limit of your BitMEX account. Requests to BitMEX servers are rate limited to 60 requests per 1 minute. This counter refills continuously.
void GetError(int &statusCode, string &name, string &message); Get the error of the last request made to BitMEX servers. If a large number of 4xx or 5xx responses are delivered in a short period of time, your IP may be banned for an hour from BitMEX servers. Multiple bans in a short time will result in a week ban.


Warnings

You acknowledge and agree that trading on BitMEX real accounts should only be used by you if you:

i) have knowledge and experience in highly volatile markets;
ii) are trading with Bitcoin you can afford to lose; and
iii) have a high-risk tolerance;

If any of these statements do not apply it to you, please start by getting knowledge and apply it first to the BitMEX Testnet.






评分 1
Kryptoman10
35
Kryptoman10 2019.12.15 22:35 
 

Excellent experience so far. Thanks Romeu!

Additional Updates

推荐产品
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
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
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
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
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
Static Text display
Muhammad Saad Khan
静态文本显示 是一个轻量且用户友好的 MetaTrader 5 专家顾问(EA),旨在通过在您的图表上直接显示激励性交易提示来启发和教育交易者。凭借优雅的居中黑色背景和等宽字体白色文本,该 EA 以轮换片段形式提供简洁、可操作的建议,帮助您专注于纪律交易。适合初学者和经验丰富的交易者,它倡导风险管理、耐心和策略开发等关键原则。 主要功能: 动态提示显示 :将用户定义的交易提示分割为 50-60 个字符的可读片段,每隔几秒轮换一次(持续时间可自定义)。 专业设计 :在图表顶部中心显示提示,带有黑色背景,确保可读性和均匀填充。 响应式定位 :在图表大小调整或切换时自动调整文本和背景对齐。 可自定义设置 :根据您的偏好调整字体大小、文本颜色、背景颜色和显示持续时间。 开关控制 :无需移除 EA 即可轻松启用或禁用显示。 轻量高效 :资源占用极低,不影响平台性能。 为什么选择静态文本显示? 无论您是想提升交易纪律还是寻求每日动力,此 EA 始终将核心交易智慧置于显眼位置。默认提示强调风险管理、策略测试和情绪控制,但您可以自定义文本以匹配您的交易理念。适合重视教育和一致性的交易者。 输入参数:
FREE
Universal MarketInfo Service Library for MT4 & MT5 Bring simplicity and power to your trading projects with the Universal MarketInfo Service — a professional library that exposes a unified API for both MetaTrader 4 and MetaTrader 5. No more rewriting code for each platform. With this library, you can: Access symbol data, OHLC prices, spreads, and volatility with a single call. Query account balance, free margin, stop levels, and lot constraints. Work with currency precision, pip values, and n
FREE
MyTradingHistory
Max Timur Soenmez
一个易于使用的库,为开发者提供关键交易统计数据的便捷访问,适用于其MQL5 EA。 库中的可用方法: 账户数据和收益: GetAccountBalance() : 返回当前账户余额。 GetProfit() : 返回所有交易的净利润。 GetDeposit() : 返回总存款金额。 GetWithdrawal() : 返回总取款金额。 交易分析: GetProfitTrades() : 返回盈利交易的数量。 GetLossTrades() : 返回亏损交易的数量。 GetTotalTrades() : 返回执行的总交易数。 GetShortTrades() : 返回卖空交易的数量。 GetLongTrades() : 返回多头交易的数量。 GetWinLossRatio() : 返回盈利与亏损交易的比例。 GetAverageProfitTrade() : 返回每笔盈利交易的平均利润。 GetAverageLossTrade() : 返回每笔亏损交易的平均亏损。 GetROI() : 计算投资回报率。 GetLargestProfitTrade() : 返回单笔交易的最大利润。 Get
LSTM Library
Thalles Nascimento De Carvalho
LSTM Library - MetaTrader 5的高级神经网络 专业算法交易神经网络库 LSTM Library为您的MQL5交易策略带来递归神经网络的强大功能。这个专业级实现包括LSTM、BiLSTM和GRU网络,具有通常只在专业机器学习框架中才能找到的高级功能。 "交易机器学习成功的秘诀在于正确的数据处理。 垃圾进,垃圾出 –您的预测质量永远不会超过您的训练数据质量。" — 马科斯·洛佩兹·德·普拉多博士, 金融机器学习进展 主要特点 完整实现LSTM、BiLSTM和GRU 递归Dropout实现更好的泛化 多种优化算法(Adam, AdamW, RAdam) 高级归一化技术 全面的指标评估系统 训练进度可视化 支持通过类权重处理不平衡数据 技术规格 纯MQL5实现 - 无外部依赖 为交易应用程序优化 全面的错误处理和验证 完全支持保存/加载训练模型 详尽的文档 集成说明 要将LSTM Library集成到您的Expert Advisor中,请按照以下步骤操作: 1. 完整库导入 #import "LSTM_Library.ex5"    // 库信息    void Get
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
Lib5 EAPadPRO for MT5
Vladislav Andruschenko
4.5 (6)
EAPADPRO Library for MetaTrader 5 是一个免费的专业界面库,用于为您的 Expert Advisor 添加现代化的信息面板。 该库专为 MQL5 开发者设计,适合希望让自己的交易程序在 MetaTrader 5 图表上拥有更清晰、更专业、更有信息价值的视觉呈现。 MetaTrader 5 的 Expert Advisors 通常包含更复杂的逻辑、多组设置、Magic number 过滤、订单执行规则以及内部策略数值。EAPADPRO 可以将这些信息整理到一个结构化面板中,让用户更快、更直观地理解程序当前状态。 EAPADPRO for MT5 是一个免费库。 您可以使用它来提升 Expert Advisor 的界面、信息输出和整体视觉质量。 完整的分步集成说明: LIB - EAPADPRO 分步集成教程 EAPADPRO 面板详细说明: EAPADPRO 信息面板 MetaTrader 4 版本: EAPADPRO Library for MT4 MQL5   Channel  https://www.mql5.com/en/channels/expf
FREE
SimpleLotCalculator
Itumeleng Mohlouwa Kgotso Tladi
SimpleLotCalculator: Professional Multi-Symbol Risk Manager Library Stop guessing your lot sizes and start trading with institutional precision. SimpleLotLogic is a high-performance MQL5 developer library designed to solve the number one problem for algorithmic and manual traders: Risk Management. Instead of writing complex math for every new EA, simply plug in this library to calculate the perfect lot size based on your account equity and stop-loss distance. Why Choose SimpleLotLogic? Precis
Pre Market High Breakout EA
Leonardo Guia Gonzalez
-- [ MODULE 1: STRATEGY OVERVIEW ] --- TPFX Premarket High Breakout is a specialized trading algorithm designed to capture the high-volatility momentum that occurs immediately after the US Pre-market session concludes. Unlike traditional breakout systems, this engine is tuned to identify significant liquidity shifts in US Indices. The strategy automatically defines a reference range based on the Pre-market activity and executes trades only when specific price action validation occurs. It is opt
Delete Only Pending Orders
Muhammad Usman Siddique
适用于 MetaTrader 5 (MT5) 的 UZFX - 仅删除挂单脚本是一款简单而有效的工具,可自动删除交易账户中的所有挂单(限价买入、限价卖出、止损买入、止损卖出)。该脚本非常适合希望在不影响活跃市场头寸的情况下即时清除挂单的交易者。 查看我的所有其他 MT4/MT5 指标和 EA >> 这里 功能: 删除所有挂单(买入限价单、卖出限价单、买入止损单、卖出止损单)。 不影响未结市场头寸。 通过专家选项卡提供实时执行反馈。 帮助交易者快速重置挂单策略,无需手动干预。 使用方法: 将脚本附加到 MT5 图表。 脚本将自动扫描并删除所有挂单。 注意: 该脚本不会关闭有效交易,只会删除挂单。 运行脚本前,请确保您要删除所有挂单。 它适用于账户中的所有交易符号,而不仅仅是所附图表。 开发者: UZFX-LABS Version: 1.00 Year: 2025 下载 mt4 脚本 : 133840
FREE
TeleSignal
Vincent Jean Robert Trolard
TeleSignal EA is an intelligent Expert Advisor designed to automatically send Telegram notifications whenever a position is opened, closed, or modified in MetaTrader 5 . It allows you to monitor your trades in real time , wherever you are — no need to keep your trading platform open. Through its direct integration with the Telegram API, you’ll receive clear and instant messages showing: Trade opened (symbol, lot size, order type, entry price) Trade closed (exit price, profit/loss, trade du
Stoch Mantis
Channaphat Yamuangmorn
Title: Stoch Mantis Description: Stoch Mantis is a professional multi-timeframe utility designed to monitor the Stochastic Oscillator across your current chart while providing a broader trend context using the 200 EMA. This tool does not execute trades automatically; instead, it serves as a highly efficient alert system and market analyzer for manual traders who utilize pullback strategies. Trading extreme zones on lower timeframes can be risky without considering the major trend. Stoch Mantis
FREE
Synapse AI Quantum
Napat Puangjunkum
SYNAPSE AI QUANTUM    Cognitive Trading Core    Under the hood, the Synthetic Neural Core continuously evaluates 5 distinct mathematical layers (RSI, Bollinger Bands, ATR, Momentum, and EMA). The system calculates a consensus score, and only initiates a precise, single linear trade when at least 3 layers are in absolute agreement.  No Grid. No Martingale. Just pure cognitive precision with Fixed R:R linear execution. === WHY SYNAPSE AI QUANTUM? === 1. COGNITIVE TRANSPARENCY HUD: Watch the EA "
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
OpenAI Library MT5
VitalDefender Inc.
该库旨在提供一种尽可能简单的方法,直接在MetaTrader上使用OpenAI的API。 要深入了解库的潜力,请阅读以下文章: https://www.mql5.com/en/blogs/post/756098 The files needed to use the library can be found here: Manual 重要提示:要使用EA,需要添加以下URL以允许访问OpenAI API  如附图所示 要使用该库,需要包含以下Header,您可以在以下链接找到:  https://www.mql5.com/en/blogs/post/756108 #import "StormWaveOpenAI.ex5" COpenAI *iOpenAI(string); CMessages *iMessages(void); CTools *iTools(void); #import 这就是您需要的所有信息,以便轻松使用该库。 以下是如何轻松使用该库并与OpenAI的API交互的示例 #include <StormWaveOpenAI.mqh>       //--- 包含用于AP
EA(交易专家)会在纽约交易时段市场开始波动时开仓(交易量增加)。因此,冲量得到了交易量的支持,我们可以以较高的概率迅速达到止盈(Take Profit)。 信号  https://www.mql5.com/en/blogs/post/764450 纽约交易时段的冲量入场 EA通过低时间框架上的FVG(公平价值缺口)检测隐藏的冲量。如果冲量在纽约交易时段之前或期间被检测到,EA会开仓。 根据市场动态管理仓位 如果冲量迅速消失,EA会采用以下三种策略之一: 在某个已识别的价格水平触发止损,并停止交易。 触发止损后,在相反方向开设新仓位。 继续管理原始仓位,通过增加或减少仓位直至获得利润。 如何使用 购买后,请与我联系以获取详细的设置说明。EA运行需要网络连接(内部使用了Rithmic验证的订单簿数据)。 如何进行回测 在黄金(XAUUSD)上运行测试。 时间框架:1分钟。 在输入字段“Lot Factor”中设置手数。1x表示0.01手,10x表示0.1手,以此类推。 设置您的账户货币中的最大允许回撤,例如100美元。如果达到指定的回撤值,所有仓位将被关闭。
SMC Structure Markup
Seyed Mohammad Hosseini Hejazi
4.67 (15)
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
该产品已经开发了 3 年,它是 MQL5 编程语言中最先进的人工智能和机器学习代码库。它已被用于创建多个基于 AI 的交易机器人和指标,适用于 MetaTrader 5。 这是一个高级版,基于免费开源的 MQL5 机器学习项目,链接如下:  https://github.com/MegaJoctan/MALE5 。免费版本功能较少,文档较少,维护不足,仅适用于小型 AI 模型。 该高级版包含您编写 AI 交易机器人的所有必需工具。 为什么要购买此库? 非常易于使用,代码语法友好,类似于 Python 的流行 AI 库,如 Scikit-learn、TensorFlow 和 Keras。 文档齐全,提供丰富的视频、示例和文档,帮助您快速上手。 计算优化,性能优越,运行方式类似普通 EA。  无需额外依赖,无需 DLL 文件,所有内容可编译为单一 .EX5 文件,便于测试和分发。 全天候技术支持,我将提供帮助,确保您正确使用,并在问题出现时协助修复。  谁适合使用此库? 具有基本机器学习和 AI 知识的用户。 机器学习爱好者,特别是来自 Python ML 社区的开发者。 MQL5 中级
UZFX - 删除图表上的所有图形和对象是一个简单而功能强大的Metatrader 5(MT5)脚本,旨在立即从活动图表中删除所有绘图对象。该脚本对于需要从技术分析图,趋势线,斐波那契工具,文本标签和其他对象中快速清除图表的交易者很有用,而无需手动删除它们。 特征: 在活动图表上删除所有对象和图纸。 立即使用单个执行。 显示成功和失败删除的确认消息。 帮助交易者保持清洁无杂乱的图表以进行更好的分析。 用法: 将脚本连接到要删除所有对象的图表上。 脚本将自动循环遍历所有对象并删除它们。 专家选项卡中的一条消息将确认成功删除对象。 注意:此脚本不会影响图表上运行的开放订单,指标或专家顾问,而仅删除仅图形对象。 开发人员:Usman Zabir -UZFX 版本:1.00 年:2025年 网站:https:// www.mql5.com/en/users/forextycoons
FREE
1. Why did I develop this series of indicators I found that most traders need to use multiple time frame indicators. They usually switch time frame to see indicators. However, once the timeframe is switched, you cannot see the  corresponding relationship  between  the price in the smaller timeframe  and  the indicator in the larger timeframe . For example: if your price chart is in H1 timeframe, you can see H4, D1 and W1 indicators in H1 timeframe Chart. This is more helpful for you to find th
This simple logging library is designed to provide clear and contextual log output with minimal hassle. It exposes five  methods: LogError Message (message) LogWarn Message (message) LogInfo Message (message) LogDebug Message (message) LogTrace Message (message) Each method prints the provided message to the console only if the severity level meets or exceeds the current threshold set by a global variable logLevel. This means you control the verbosity of your application's logs by adjusting logL
FREE
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
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
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
Trading Notes   is an innovative tool designed for traders to streamline their decision-making process by allowing them to write and display important reminders or short details directly over their trading charts. This essential feature ensures that traders have quick access to their personalized checklist before opening any positions, enhancing their trading efficiency and accuracy. MT4 Version -  https://www.mql5.com/en/market/product/120613 Join To Learn Market Depth -  https://www.mql5.co
FREE
Overview AlgoNLP.mqh   is a standalone MQL5 library that converts   human-written trading instructions   into   structured trade intents   that your Expert Advisor (EA) or indicator can understand. Example input: Buy gold at 2370 with TP 0.3% and SL 1% Output intent: Side: BUY | Type: LIMIT | Symbol: XAUUSD | Entry: 2370 | TP: 0.3% | SL: 1% | Lot: 0.00 This enables you to build   chat-controlled   or   Telegram-integrated EAs   that can interpret plain English commands and execute structured
FREE
该产品的买家也购买
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
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、减小仓位量,保持绝对的安全距离。 适用 场景:对未来趋势相对确定,不想错过当前行情,但是认为当前持仓体量又有点大,想降低仓位。
【黄金智能交易EA|风控稳守,盈利突围】 专为黄金波动特性定制的智能交易EA,以硬核交易系统为核心,每笔下单均源自量化模型对行情趋势、支撑压力的精准研判,杜绝主观干扰,让交易决策更客观高效。 搭载多维风控体系,动态止损止盈+仓位智能调控双保险,严格锁定单笔风险阈值,即便面对黄金跳空、黑天鹅行情,也能有效规避大幅回撤,守护本金安全。 更具备浮盈加仓智能算法,趋势明朗时自动放大盈利头寸,让利润在顺势中滚动增长,既不浪费单边行情红利,又通过阶梯式加仓策略平衡风险与收益,实现“风控打底,盈利上不封顶”的交易闭环! 本款EA历经38次修改与测试,每一次升级都境加了EA的稳定盈利能力,才最终确定此为终极版本发布。 本款EA目前只针对现货黄金 交易的长期回测和实盘验证,按照下图设置实现长期的稳定 盈利。如果需要交易期它品种,请根据实际情况更改设置。 本EA为阶梯定价,每卖出10份价格增加10%
本 EA 专为震荡 / 横盘行情设计。 在设定区间内自动补单交易 EA 仅在 预先设定的价格区间内运行 。 当订单平仓、成交、取消后(单数量少了),EA 会自动补充新的订单,以维持交易策略的持续运行。 您以通过 Max Orders 来控制最大订单数量。 示例: 最大订单数(Max Orders):8 当前持仓订单:2 单 挂单 Buy Limit:6 单 在这种情况下,EA 不会继续下新单。 只有当订单 平仓、成交 、 取消 后,EA 才会 自动补单 ,持续捕捉 震荡行情 中的利润。 注意: Buy Limit 订单 只会挂在当前市场价格的下方 。 产品参数说明 Trade Symbol : 交易品种  XAUUSD、USDJPY、BTCUSD 等等... 区间设置 Zone Low :区间下边界 Zone High :区间上边界 说明: 例如,您将黄金的交易区间设定为: Zone Low :4420 Zone High :4455 EA 只会在该价格区间内挂单并自动交易。 当价格突破区间范围时,EA 将停止交易。 当价格回到区间内,EA 会自动恢复交易。 订单设置
本 EA 专为震荡 / 横盘行情设计。 在设定区间内自动补单交易 EA 仅在 预先设定的价格区间内运行 。 当订单平仓、成交、取消后(单数量少了),EA 会自动补充新的订单,以维持交易策略的持续运行。 您可以通过 Max Orders 来控制最大订单数量。 示例: 最大订单数(Max Orders):8 当前持仓订单:2 单 挂单 Sell Limit:6 单 在这种情况下,EA 不会继续下新单。 只有当订单 平仓、成交 、 取消 后,EA 才会 自动补单 ,持续捕捉 震荡行情 中的利润。 注意: Sell Limit   订单 只会挂在当前市场价格的上方 。 产品参数说明 Trade Symbol : 交易品种  XAUUSD、USDJPY、BTCUSD 等等... 区间设置 Zone Low :区间下边界 Zone High :区间上边界 说明: 例如,您将BTCUSD的交易区间设定为: Zone Low : 92000 Zone High : 94500 EA 只会在该价格区间内挂单并自动交易。 当价格突破区间范围时,EA 将停止交易。 当价格回到区间内,EA 会自动恢复
A complete PostgreSQL client implemented in pure MQL5 over native MetaTrader 5 TCP sockets. The library implements the PostgreSQL client with MD5 and SCRAM-SHA-256 authentication, SSL/TLS, the Simple Query Protocol, and explicit transactions. No DLLs, no external dependencies, no third-party services. Features Direct TCP connection to any PostgreSQL-compatible database MD5 and SCRAM-SHA-256 authentication, auto-detected SSL/TLS via PostgreSQL's SSLRequest flow Full transaction support Typed res
WalkForwardOptimizer MT5
Stanislav Korotky
3.78 (9)
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.
ModernUI Library
Levi Dane Benjamin
适用于 MetaTrader 5 的 ModernUI 库 ModernUI 是一个用于 MetaTrader 5 的图表内用户界面库。它可以帮助 MQL5 开发者在 MT5 图表环境中构建更清晰的 EA 面板、仪表盘、设置窗口、表单、表格、对话框、抽屉式面板以及紧凑型交易风格界面。 它适合希望获得比零散图表对象更专业的界面层,同时仍然完全掌控自己 EA、指标或工具逻辑的开发者。 Modern UI - 用户指南   | EA 示例演示 你可以构建什么 ModernUI 并不局限于某一种面板类型。它为你提供了一个可复用的界面层,几乎可以用于任何你想在 MetaTrader 5 图表中构建的工具。 你可以用它创建简单的设置界面、紧凑型交易面板、完整仪表盘、数据视图、控制面板、账户工具、流程界面、监控界面、实用工具窗口、商业 EA 前端界面等等。 随附的演示展示了几个实用示例,但它们只是起点。如果你的 MQL5 项目需要按钮、输入框、表格、对话框、标签页、抽屉面板、图表、状态区域,或需要一种更清晰的方式在图表上展示信息,ModernUI 都可以为你提供构建模块。 主要功能 适用于 Me
If you just want to simply copy your positions and orders from MetaTrader to Binance use the Binance Copier If you're a developer looking to use Binance.com and Binance.us exchanges directly from your MetaTrader 5 terminal, you'll want to check out Binance Library MetaTrader 5. This powerful tool allows you to trade all asset classes on both exchanges, including Spot, USD-M   and COIN-M futures, and includes all the necessary functions for trading activity. Important: you need to have source c
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
本服务程序下载后,将作为 Dom BookHeatMAP Lightning Trading Panel 的服务支持程序使用。 Dom BookHeatMAP Lightning Trading Panel   下载地址: https://www.mql5.com/zh/market/product/159414?source=Site+Market+MT5+Search+Rating006%3aDom+BookHeatMAP+Lightning+Trading+Panel 请您先将下载的文件拖拽至 MT5 数据目录下的对应服务文件夹( `MQL5\Services`)内,并确认文件已成功放置。随后,双击运行启动服务,系统将自动加载相关组件并初始化服务环境。 具体操作位置详见截图:按照截图所示流程完成启动后,Dom BookHeatMAP Lightning Trading Panel 的主界面将正常显示,此时您即可启用其全部功能,体验高效、流畅的 DOM 闪电交易服务,包括实时深度图热力图监控和快速订单执行等核心特性。 请注意,为保障交易系统稳定运行,务必确保该服务程序中设置的交
该库将允许您使用任何 EA 来管理交易,并且非常容易集成到任何 EA 上,您可以使用描述中提到的脚本代码以及显示完整过程的视频演示示例自行完成。 - 下限价、止损限价和止盈限价订单 - 下达市场订单、SL 市场订单、TP 市场订单 - 修改限价订单 - 取消订单 - 查询订单 - 更改杠杆、保证金 - 获取位置信息 和更多... 租赁加密货币图表是可选的,除非您的 MT5 上没有币安图表。 对于脚本演示:单击此处 如果您想与交易面板进行交易,您可能对此产品感兴趣 该产品是加密图表的插件 该库将允许您使用任何 EA 来管理交易,并且非常容易集成到任何 EA 上,您可以使用描述中提到的脚本代码以及显示完整过程的视频演示示例自行完成。 - 下限价、止损限价和止盈限价订单 - 下达市场订单、SL 市场订单、TP 市场订单 - 修改限价订单 - 取消订单 - 查询订单 - 更改杠杆、保证金 - 获取位置信息 和更多... 租赁加密货币图表是可选的,除非您的 MT5 上没有币安图表。 对于脚本演示: 单击此处 如果您想与交易面板进行交易, 您可能对
GetFFEvents MT5 I tester capability
Hans Alexander Nolawon Djurberg
Want to get all events like Previous/Forecast/Actual values for each news to analyze/predict it? By this simple library you can do it easily,Just import/integrate the library into your system,then get all possible values for each news   Even In Strategy Tester   . Note: Please add the address " https://www.forexfactory.com/ " of news feed at your MT5 tab > Tools > Options > Expert Advisors > Check Allow web request for listed URL. Since the WebRequest() function can't be called from indicator ba
这是一个可以定时自动交易的EA。根据你设定的时间,精确到秒,可以设置最多下几单。下单buy或者Sell.可以设置值止盈止损点。并且可以设定在下单后多久平仓。一般都是用来做事件。祝你好运。 请看图片自己根据设定来使用。每一次使用请重新加载EA。不用的时候记得关闭EA按钮。 我来举个例子。比如英国央行利率决议。你在最后两秒下单(设置的是你本机的时间)。因为可能瞬间点差扩大,你可能不敢直接下最大手数,所以你可以选择小手分批从最后5秒开始进场。我相信做过的人知道我说的意思。因为我专业做这个已经十年。最近才做出了这个自动化EA。并且这里面有个检测就是你点击开始之后如果超过了你设定的时间十秒他就不会执行了。保证你的安全。你自己用DEMO账户测试几次你就知道我这个有多好用了!
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
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
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
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
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     
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
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 );    //复杂开单
1. 这是什么 MT5系统自带的优化结果非常少,有时候我们需要研究更多的结果,这个库可以让你在回测优化时可以输出更多的结果。也支持在单次回测时打印更多的策略结果。 2. 产品特色 优化的输出的结果非常多。 可以自定义CustomMax。 输出结果在Common文件夹。 根据EA名称自动命名,且同一个EA多次回测会自动更新名称,不会覆盖上一次的结果。 函数非常简单,你一眼就可以看懂。 #import "More BackTest Results.ex5" // Libraries Folder, Download from the market. //---Set CustomMax void iSetCustomMax( string mode); //---Display multiple strategy results when backtesting alone (not opt). void iOnDeinit(); //--- void iOnTesterInit(); double iOnTester(); void iOnTesterPass( string lang
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. 
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
A Simple Moving Average (SMA) is a statistical indicator used in time series analysis. This indicator represents the arithmetic mean of a sequence of values over a specific period of time. SMA is used to smooth short-term fluctuations in data, helping to highlight the overall trend or direction of changes. This aids analysts and traders in better understanding the general dynamics of the time series and identifying potential trends or changes in direction.  More information you can find in Wiki 
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
This trailing stop application will helping trader to set the trailing stop value for many open positions, that apply a grid or martingale strategy as a solution. So if you apply a grid or martingale strategy (either using an EA or trading manually), and you don't have an application to set a trailing stop, then this application is the solution. For EAs with a single shot strategy, just use the FREE trailing stop application which I have also shared on this forum.
作者的更多信息
Crypto Charts
Romeu Bertho
4.11 (9)
Crypto Charts is a Service that connects to cryptocurrency exchanges and delivers three types of market data in a single package: historical and live OHLCV candles, real-time tick data, and Depth of Market (order book). All data is pushed into MT5 as custom symbols that behave like native instruments, accessible on charts, in indicators, Expert Advisors, and the Strategy Tester. Traders who prefer MT5's analysis environment can use Crypto Charts to work with cryptocurrency markets using the same
Percent Crosshair is a powerful and easy percentage measure tool. Measure the chart percentage quickly! Don't waste your time anymore! Just attach the Percent Crosshair indicator to the chart, select crosshair mode at toolbars or press Ctrl+F and start using the crosshair as you always do! The percent measure will be next to the indicative price. Customize your indicator the way you want! There are four entry parameters: Positive % color: set the desired color when % is positive. Negative % colo
Percent Crosshair is a powerful and easy percentage measure tool. Measure the chart percentage very quick! Don't waste your time anymore! Just attach the Percent Crosshair indicator in the chart, select crosshair mode at toolbars or press "Ctrl+F" and start using the crosshair as you always do! The percent measure will be next to the indicative price. Customize your indicator the way you want! There are 4 entry parameters: Positive % color: set the desired color when % is positive. Negative % co
Order Flow Balance
Romeu Bertho
5 (1)
Order Flow Balance is a powerful indicator for Tape Reading (Time & Sales). It helps you analysis Order Flow Market, find where the players are moving in, market imbalance, possible reversal points and much more! The indicator works on MOEX, BM&FBOVESPA, CME, etc. It has 5 different indicator types Cumulative Delta: Also know as Cumulative Volume Delta, it is an advanced volume analysis method where traders can see the daily difference between aggressive buyers and aggressive sellers. Comparison
A complete PostgreSQL client implemented in pure MQL5 over native MetaTrader 5 TCP sockets. The library implements the PostgreSQL client with MD5 and SCRAM-SHA-256 authentication, SSL/TLS, the Simple Query Protocol, and explicit transactions. No DLLs, no external dependencies, no third-party services. Features Direct TCP connection to any PostgreSQL-compatible database MD5 and SCRAM-SHA-256 authentication, auto-detected SSL/TLS via PostgreSQL's SSLRequest flow Full transaction support Typed res
筛选:
Kryptoman10
35
Kryptoman10 2019.12.15 22:35 
 

Excellent experience so far. Thanks Romeu!

Additional Updates

回复评论