贸易环境是忙中出错导致恶梦黄牛和高频交易. 当他们打开了太多图表或地方太多,为了MetaTrader的扼流圈. 问题来自MT4如何处理茎,从代理服务器接收信息.
该OrderSend() 命令, 哪 MQL程序员 用来打开贸易, 还告诉MT4客户终端等待服务器响应. 一切都锁起来. 该代码不能做任何事情,直到服务器允许客户端继续. 更重要的是, 交易终端不允许任何额外的交易开.
例
考虑这样你交易EURUSD一个场景, 在H1图表澳元兑美元和美元兑日元货币对. MT4必须等待传入前打勾MQL允许它做出交易决策. 我几个月前有讨论过这个问题 基于时间的订单.
多种货币在液体小时蜱常组合在一起. 如果该终端接收在几百毫秒到对方的传入蜱, MetaTrader的创建自己的瓶颈.
澳元兑美元打勾谁先. 专家顾问看到了交易机会,并决定打开与OrderSend的澳元兑美元交易(). 150 ms后欧元兑美元打勾进来,并创建另一个交易机会. 欧元兑美元EA, 它运行在一个完全不同的图表, 不允许交易.
重试延迟交易作业忙
我们的 专家顾问程序员 检查 “贸易Context是忙” 订单发送给代理之前的错误. 当这种情况退出, 在EA检查贸易背景下的每 50 毫秒至 50 时.
为MetaTrader订单可以采用第二个或更多个来执行它的情况并不少见. 从我们的例子中,澳元兑美元最初的贸易仍挂在那里. 欧元兑美元EA进入 50 毫秒周期中它不断询问, “没有贸易背景下开放?”
那么美元兑日元打勾进来 70 欧元兑美元打勾ms后. 美元兑日元遭遇同行业范围内的问题, 踢它到一个单独的, “是交易繁忙的情况下” 环.
当澳元兑美元交易最终执行, 它的叶子在一个疯狂的比赛中,欧元兑美元和美元兑日元的专家顾问,以发现新开的交易窗口. 该发现交易方面忙碌的错误消失将首先发送其请求的第一个EA. 第二个EA, 不幸, 不能与所述第一通信. 虽然第二EA会发现,贸易方面开辟了, 它会收到交易conext是忙中出错,当它试图交易; 杉杉EA已经发出交易请求. 第二次专家顾问下发本身就是一个最大的 10 故障才放弃在贸易.
假设欧元兑美元首次发现新的交易窗口, 那么美元兑日元接收其第一次失败的尝试阶. 美元兑日元再次询问关于交易方面的每 50 女士. 欧元兑美元交易最终执行, 使美元兑日元终于进入市场.
我们的大多数客户不会注意到这种延迟, 这意味着,我们做我们的工作. 有, 然而, 一个突破点在哪里的MetaTrader根本无法在速度发出足够的订单,交易者的欲望. 图表其中的任意组合 10 或以上的订单熄灭近同时会导致错失交易机会.
迈达克MT4设计与贸易方面的错误,以限制经纪人的加工要求. As I’ve stated repeatedly, 经纪人获得迈达克’ 优待,因为他们是那些支付迈达克’ 费. MetaTrader的是不是一个高频交易平台. It’s not in the broker’s interest to support high speed trading. 它通常打开它们太多贸易商趁势 仲裁 机会.
罗恩 说
该 “贸易范围内是忙” error will only occure depending on which broker you use. And this is even using the same EA’s working together completing the same trades. The Trade Context is Busy can wipe out your money, because it causes the draw down to get larger. You should choose a broker that will allow trading.
dMM() Michal 说
很好,
let me drop a few words on MT4 multi-thread design.
The Hi-Frequency & Scalping startegists and all manual Traders altogether shall be aware, that MT4 shares only one common-logic thread for trading OPS. This simplified the MT4 core-design at MetaQuotes (forgive me to point at the very source of real-world problems noticed below ), but complicates our lives as we all strive to live in a near-real-time execution loops to crawl the FOREX market events.
所以, once a Trader moves past a landmark of a few manual trades per week, the near-real-time issues grow and become more painfull.
As a rule of thumb, one shall continuously monitor the QoS of the Brokerage Service she/he has contracted to use.
The End-To-End nature of the Trading Ops introduces the following bottlenecks / single-point-of-failure(s):
一) a MT4_Terminal thread contention — ref. MQL4 IsTradeContextBusy() 测试. I personally prefer to continuously monitor / measure / log this, to map the ability of my Brokers ( the Vendors of the access to the FOREX Market ) to accept + transact + execute my orders in near-RealTime mode. ( ask for detailed statistics in LDF()/GDF() graphs & RT-measurement tools )
B) a to MT4-Server comms path — ref. IP networking / E2E latency / first-mile UpStream congestion / traffic-concentrator ( aggregator ) grooming factor / FUP policies etc ( for non-DataCentre hosted MT4-Terminal )
Ç) a MT4-Server work-load / load-balancing — ref. GetLastError() / ERR_TRADE_TIMEOUT / ERR_SERVER_BUSY / ERR_TOO_MANY_REQUESTS / ERR_TOO_FREQUENT_REQUESTS
ð) a to MT4_Terminal comms path — ref. IP networking / E2E latency / last-mile DownStream congestion ( for non-DataCentre hosted MT4-Terminal )
For any near-RealTime scenarios, it is wise to measure and collect RT-data about communication with the Broker .
Statistics about these E2E transactions are vital to know beforehand,
whether one may rely on a Broker Data-processing capabilities and execute Trading OPS within a few tens of [msec], or have to wait hundreds of [msec] 或 ( 信不信由你 ) whether you have to expect more than 2 – 6 秒, to get your MT4-Terminal Trading thread ready ( released free from aTradingContextBUSY.state back again ready to study and serve another Trading Operation “in-the-queue”.
Supposing one may imagine, how painfull this can be once you manage some 10, 20, 50 Orders under some tight conditions under your intensive order-management technique and how thrilling under that condition would be to have to wait for 20 – 60 seconds for each of them to get modified / closed at the side at your under-performing Broker machine(s).
Think – Measure – Log – Evaluate – Act
(
Change your connectivity provider / your hosting provider / your broker — it is all about money
The only one, who risks money is You,
You do risk
( but need not to risk so much )
Upon implementing a correct set of wise and preventive measures that allow you to put in place those necessary improvements in due time you can avoid a risk to lose just due to a blind belief, while an underperforming End2End Transaction Processing chain threatens your Trading Ops not only during fundamental Market events, but systematically 24/5/365
)
此致敬意
dMM() Michal / msLIB.*
dMM() Michal 说
( 哎呀, the text has lost some words due to embedded pseudo-HTML formatter & thus some hints have got lost the point … sorry for the inconvenience, no option to preview / re-edit the post. My fault not to realize that — if interested, use my email to get it fixed )
罗恩 说
The Trade context is busy” will not allow you to close a profit trade by hand.