我写了个脚本开28货币对的单子,分成A组和B组,结果经过多次测试后发现总是存在漏单的情况。
用的是MT5服务器的模拟账号,开仓失败后的错误代号是4756,查询了帮助文档 解释是发送交易请求失败。
脚本代码如何,望老师也测试一下,不胜感激。
#include <zhinengjiaoyi/jiaoyi.mqh>
jiaoyi jy;
void OnStart()
{
int magic=911;
string pairs[]={"AUDCAD","AUDCHF","AUDJPY","AUDNZD","AUDUSD","CADCHF","CADJPY","CHFJPY","EURAUD","EURCAD","EURCHF","EURGBP","EURJPY",
"EURNZD","EURUSD","GBPAUD","GBPCAD","GBPCHF","GBPJPY","GBPNZD","GBPUSD","NZDCAD","NZDCHF","NZDJPY","NZDUSD","USDCAD",
"USDCHF","USDJPY"
};
for(int i=0;i<ArraySize(pairs);i++)
{ jy.buyplus(pairs,0.01,1000,1000,pairs+"多A"+IntegerToString(i),magic);
jy.buyplus(pairs,0.01,1000,1000,pairs+"多B"+IntegerToString(i),magic);
}
Alert("总共开仓单数为"+IntegerToString(PositionsTotal()));
}
|
|
[/tr] |
|