-
主页
- MT4
- OrderSend()和OrderModify()容易出错的地方
OrderSend()和OrderModify()容易出错的地方
日期:2018-1-11
天泓评测
MT4
浏览:4589次
评论:0条
-
划点够大,一般设置10点;
-
避免重复下单,把OrderSend和OrderMoify放在一个循环中,检查错误;出现这种情况有,要么你的ea不好,缺少检查环节,重复下单;要么broker押单,然后释放,结果你的ea连续出单..
-
计算手数时,使用NormalizeDouble(price,Digits),某些服务器拒绝最小位数超过其最小允许值;
-
下单前确认IsTradeAllowed()返回true;
-
确保止损和止盈不要离Bid/Ask太近,可避免130或其它类似报错。
-
设置time-out在下单时,然后查询,设置“已解决”。
-
If you have a condition that you think specifies a new order, then ensure that it stays "OK" for a certain number of seconds/minutes. You do this by saving in a static or global int variable, the "TimeCurrent()" when it last occurred (and setting that to zero if the condition is false) and then only if it has remained true until (TimeCurrent() - saved_time) >= some_interval of seconds.
-
考虑使用LibOrderReliable.mq4加强代码库。
相关推荐
发表评论