![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
XAUUSDcheck does not test. But testing is successful because it tests everything else....
Good to know.
and as it should with
OrderSend error 131
no way
There is no error in the tester on the automatic test
I followed all the instructions and it worked:
OrderSend error 131
Uffffff!!!!I think autovalidation is the first thing a salesman has to go through.
I, too, have had my share of mistakes, and they were due to inattention.
But, autovalidation is the first wall in front of "dudes" who download free code from a codebase and try to sell it by changing the name. :-(
Unfortunately because of this there are thousands of programs in the Market from which it is difficult to find a couple of worthy ones.
I would put a special code in codebase so that Market would not accept it for sale. Because it hurts :-( here you spend years, even 5 years developing, tweaking and improving programs to make customers satisfied.
And someone downloaded the finished product changed the name - dumped it on the market for a dumping price, and that's it.... Customers think, "cheaper means I buy it".....
Like in China,
I sit on aliexpress - at least 5 sticks for GOPRO ordered cheap - the result - a week at sea - the stick rusted.
That's not my hand goes up to buy the original stick for 100 quid, which does not rust. But no, in China have already given 120 quid, and ordered another stick the same ................. Fucking greed......
and as it should with
OrderSend error 131
no way
There is no error in the tester on the automatic test
I did all the recommendations and yet :
OrderSend error 131
Uffffff!!!!You only need to check the minimum value and it's not hard at all.
I have a lot calculation function that does this.
{ int lotDigit=(int)fabs(log10(SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP)));
if(!MathIsValidNumber(lotDigit)) lotDigit=0;
{
double FreeMg =AccountFreeMargin();
double Margin =MarketInfo(Symbol(),MODE_MARGINREQUIRED);
double Step =MarketInfo(Symbol(),MODE_LOTSTEP);
double Minlot =MarketInfo(Symbol(),MODE_MINLOT);
double MaxLot =MarketInfo(Symbol(),MODE_MAXLOT);
double loty =MathFloor(FreeMg*Risk/100/Margin/Step)*Step;
loty = NormalizeDouble(loty,lotDigit);
if(loty<Minlot) loty=Minlot;
if(loty>MaxLot) loty=MaxLot;
Lots=loty;
Lots=NormalizeDouble(Lots,lotDigit);
return (Lots);}}
//================================================================
There is also an example on the market
Before calling OrderSend I check via
if (CheckVolumeValue(Lots,com) ==false )return(0);
In spite of everything, error 131 comes up again
I have a lot calculation function it does this
{ int lotDigit=(int)fabs(log10(SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP)));
if(!MathIsValidNumber(lotDigit)) lotDigit=0;
{
double FreeMg =AccountFreeMargin();
double Margin =MarketInfo(Symbol(),MODE_MARGINREQUIRED);
double Step =MarketInfo(Symbol(),MODE_LOTSTEP);
double Minlot =MarketInfo(Symbol(),MODE_MINLOT);
double MaxLot =MarketInfo(Symbol(),MODE_MAXLOT);
double loty =MathFloor(FreeMg*Risk/100/Margin/Step)*Step;
loty = NormalizeDouble(loty,lotDigit);
if(loty<Minlot) loty=Minlot;
if(loty>MaxLot) loty=MaxLot;
Lots=loty;
Lots=NormalizeDouble(Lots,lotDigit);
return (Lots);}}
//================================================================
Your lotDigit is a tricky fool that always calculates 0. It's not in the example in the documentation. Apparently you like a lot of brackets?
Also this: FreeMg*Risk/100/Margin/Step... Where did 100 come from? Obviously from the ceiling.
That's a lot of strings. It's really a lot, what are you calculating?