But still simplest code of MT4 EA couldn't be passed validation!
See the below simplest trading code
//+------------------------------------------------------------------+//| TTTTTTTTTTTTTTTTTTTTTTTTTTTT.mq4 |//| Copyright 2022, MetaQuotes Software Corp. |//| https://www.mql5.com |//+------------------------------------------------------------------+#property copyright"Copyright 2022, MetaQuotes Software Corp."#property link"https://www.mql5.com"#property version"2.43"#property strictinputdouble Lots = 0.1;
//+------------------------------------------------------------------+//| Expert tick function |//+------------------------------------------------------------------+voidOnTick()
{
//---if(CheckVolumeValue(Lots))
if(OrdersTotal()==0)
bool x = OrderSend(Symbol(),OP_BUY,Lots,Ask,10,0,0,"",1234);
}
//+------------------------------------------------------------------+//| Check the correctness of the order volume |//+------------------------------------------------------------------+bool CheckVolumeValue(double volume/*,string &description*/)
{
//--- minimal allowed volume for trade operationsdouble min_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MIN);
if(volume<min_volume)
{
//description=StringFormat("Volume is less than the minimal allowed SYMBOL_VOLUME_MIN=%.2f",min_volume);return(false);
}
//--- maximal allowed volume of trade operationsdouble max_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MAX);
if(volume>max_volume)
{
//description=StringFormat("Volume is greater than the maximal allowed SYMBOL_VOLUME_MAX=%.2f",max_volume);return(false);
}
//--- get minimal step of volume changingdouble volume_step=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_STEP);
int ratio=(int)MathRound(volume/volume_step);
if(MathAbs(ratio*volume_step-volume)>0.0000001)
{
//description=StringFormat("Volume is not a multiple of the minimal step SYMBOL_VOLUME_STEP=%.2f, the closest correct volume is %.2f",//volume_step,ratio*volume_step);return(false);
}
//description="Correct volume value";return(true);
}
//+------------------------------------------------------------------+
Mohammed Abdulwadud Soubra #: But still simplest code of MT4 EA couldn't be passed validation! See the below simplest trading code. I DON'T KNOW WHAT IS GOING ON!
Your code is missing checks for margin requirements. And you should adjust the volume, not just "prevent" it.
But it is giving NO TRADING OPERATIONS in case you are right then some trades could be opened with some errors such as 130
----
In addition, I tried one of my already published EAs with the same validation test but with out any benefit (NO TRADING OPERATIONS!)
I was reading many posts and threads (on Russian forum for example) related to this "no trading operations" issue, and I understand that there is no any universal decision for coders.
I found 3 posts (it is in Russian but you can read them with in-built online translator located on the every forum post) - the posts of the users who fixed their codes to pass validation, and they do not have this issue anymore:
1. -
If it helps anyone, here's how I passed the validation. Expert Advisor without stops and order modifications, but on all timeframes . The validator gave error 131 (wrong lot) and no trading operations. This is my first Expert Advisor, so there were probably as many errors as possible.
read post #202 about how this user fixed it for his EA.
-----------------------
2. -
Step by step I will describe my experiment with "there are no trading operations" fixing with my EA: ...
Sergey Golubev #: I was reading many posts and threads (on Russian forum for example) related to this "no trading operations" issue, and I understand that there is no any universal decision for coders.
I found 3 posts (it is in Russian but you can read them with in-built online translator located on the every forum post) - the posts of the users who fixed their codes to pass validation, and they do not have this issue anymore:
1. - read post #202 about how this user fixed it for his EA.
But still simplest code of MT4 EA couldn't be passed validation!
See the below simplest trading code
I DON'T KNOW WHAT IS GOING ON!
Your code is missing checks for margin requirements. And you should adjust the volume, not just "prevent" it.
Your code is missing checks for margin requirements. And you should adjust the volume, not just "prevent" it.
But it is giving NO TRADING OPERATIONS in case you are right then some trades could be opened with some errors such as 130
----
In addition, I tried one of my already published EAs with the same validation test but with out any benefit (NO TRADING OPERATIONS!)
But it is giving NO TRADING OPERATIONS in case you are right then some trades could be opened with some errors such as 130
----
In addition, I tried one of my already published EAs with the same validation test but with out any benefit (NO TRADING OPERATIONS!)
I understand that there is no any universal decision for coders.
I found 3 posts (it is in Russian but you can read them with in-built online translator located on the every forum post) -
the posts of the users who fixed their codes to pass validation, and they do not have this issue anymore:
1. -
The validator gave error 131 (wrong lot) and no trading operations. This is my first Expert Advisor, so there were probably as many errors as possible.
-----------------------
2. -
...
-----------------------
3. -
Still, I found a problem, by default, in the input parameters, there is a limit on the maximum lot of positions.
...
post #208
-----------------------
I was reading many posts and threads (on Russian forum for example) related to this "no trading operations" issue, and
I understand that there is no any universal decision for coders.
I found 3 posts (it is in Russian but you can read them with in-built online translator located on the every forum post) -
the posts of the users who fixed their codes to pass validation, and they do not have this issue anymore:
1. -
read post #202 about how this user fixed it for his EA.
-----------------------
2. -
post #203-----------------------
3. -
post #208
-----------------------
BAD NEWS
still problem also with Russian forum
The problem seems from mql5.com not from the programmers/seller