
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Lorentzos Roussos的线程#40 为我解决了这个问题。
他说:“卖家注意:永远不要[永远]使用MQLInfoInteger来检测您是否在测试中。”
可能这里陈述的所有验证都是真实的。但要检查的另一件事是确保不会仅通过检查市场是否开放或交易是否允许而返回
因为它们总是在 MQL5 自动测试器中:
https://www.mql5.com/en/blogs/post/686716  ;
==>
没有交易操作
此错误仅针对专家顾问。规则是:专家顾问 必须 贸易。如果您的机器人应该只在特定的交易品种时间范围内使用,那么 MetaQuotes 就是这么说的:“产品不能应用限制。所有限制都应在产品说明中标记为建议。”如果您的机器人不是按设计进行交易(例如辅助工具),请在产品属性中选择适当的类别(“实用工具”)。
出现此错误的可能原因之一是您的代码包含这样的检查:
{
return ERROR_CODE ;
}
此类条件应伴随 IsTesting()/MQLInfoInteger(MQL_TESTER) 调用。自动测试仪未连接账户,测试仪始终被视为允许交易。正确的代码应该是:
{
return ERROR_CODE;
}
我的具体检查如下:
if(!IsMarketOpened()) 返回;
改变了
if(!IsMarketOpened() && ! MQLInfoInteger ( MQL_TESTER ) ) 返回;
这解决了我使用 MQL5 自动测试仪的问题。
谢谢你的帮助,你的方法奏效了,解决了我的问题,再次非常感谢!
hi everybody., It is the first time that I write in this forum and I hope to contribute my small grain of sand. I have had the same problem that is commented here when publishing the EA on the platform and the only way to solve it has been changing the lot from 0.1 to 0.20, after doing that the EA has been automatically validated by the system.
Best Regards
hi everybody., It is the first time that I write in this forum and I hope to contribute my small grain of sand. I have had the same problem that is commented here when publishing the EA on the platform and the only way to solve it has been changing the lot from 0.1 to 0.20, after doing that the EA has been automatically validated by the system.
Best Regards
You're right. It seems that the "automatic validation " uses the minimum lot size of 0.2 (at least for now, they might change it).
To be honest, I think it's really bad and I hope they change it to 0.01. These constraints force the developers to implement an automatic conversion to the minimum allowed lot size.
You might ask - so, what is wrong with this? Well, if the client didn't know that the minimum lot is 0.1 instead of the default of 0.01, he'll risk 10x the money! You might say "it's client's responsibility to know these things". Well, I'd say it's the dev's responsibility to make sure the EA follows its input parameters. If it says 0.01, the EA should either use 0.01 lot, or not trade at all. It's safe this way. Yet, the "automatic validation" won't allow such safe EAs to be published.
Hello guys,
I'm having the same problem when trying to validate my EA.
So I made a very simple EA, trying to understand what's wrong. And still doesn't work.
Thanks in advance for your help.
You're right. It seems that the "automatic validation " uses the minimum lot size of 0.2 (at least for now, they might change it).
To be honest, I think it's really bad and I hope they change it to 0.01. These constraints force the developers to implement an automatic conversion to the minimum allowed lot size.
You might ask - so, what is wrong with this? Well, if the client didn't know that the minimum lot is 0.1 instead of the default of 0.01, he'll risk 10x the money! You might say "it's client's responsibility to know these things". Well, I'd say it's the dev's responsibility to make sure the EA follows its input parameters. If it says 0.01, the EA should either use 0.01 lot, or not trade at all. It's safe this way. Yet, the "automatic validation" won't allow such safe EAs to be published.
I made that recommendation, and it worked for me to finally upload a new version of my EA.
Thank you very much!
But for that I put this code in the EA, so that in the Test it uses the 0.20 lot.
Hi Rio Purwanggono:
Your suggestion worked like a charm!
Made the code changes you suggested and this time validation passed!
Thank you so much!
Best regards,
Abhi
hi everybody., It is the first time that I write in this forum and I hope to contribute my small grain of sand. I have had the same problem that is commented here when publishing the EA on the platform and the only way to solve it has been changing the lot from 0.1 to 0.20, after doing that the EA has been automatically validated by the system.
Best Regards
This is the solution that worked for me after trying everything else......................simply changed the lot size to 0.2
Thanks Juan
mt4 product validation failed , no trading operations
you can use the following include for opening market orders (not pending) , it passes validation .