
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
Hello all! Who was able to bypass the check with a balance of $ 1, I have in my code is check if not enough money trade operations do not perform. Accordingly I get the following validation log
there are no trading operations
test on NZDUSD,H1
there are no trading operations
test on GBPUSDcheck,M30
there are no trading operations
test on XAUUSDcheck,Daily
there are no trading operations
What if at the initialisation stage you check the balance, check the minimum required margin for the min. lot and, if not enough, just don't start the Expert Advisor?
tried it does not help
Hm. Interesting, given that, in fact, the output at the initialisation stage means that the input parameters, which in this case could include the balance...
Does the Expert Advisor give out an error in this case? Or it silently "departs"?
Hm. Interesting, given that, in fact, the output at the initialisation stage means that the input parameters, which in this case could include the balance...
Does the Expert Advisor give out an error in this case? Or it silently "departs"?
I am adding this code
{
if(AccountFreeMarginCheck(_Symbol,OP_BUY,SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN))<=0.0)
{
return(INIT_PARAMETERS_INCORRECT);
}
i get this response
there are no trading operations
test on NZDUSD,H1
2016.02.01 00:00 exp_martin_new NZDUSD,H1: initialization failed (32767)
there are no trading operations
validation failed again.
I add this code
In fact, there's an article on the subject. And there's a code:
{
double free_margin=AccountFreeMarginCheck(symb,type,lots);
//-- если денег не хватает
if(free_margin<0)
{
string oper=(type==OP_BUY)? "Buy":"Sell";
Print("Not enough money for ", oper," ",lots, " ", symb, " Error code=",GetLastError());
return(false);
}
//-- проверка прошла успешно
return(true);
}
So if anyone doesn't like something, link to this article.
MT5? Apparently MT4. Why only check in the tester?
What do you mean in the tester? When trading, I have the check organised in the order opening function
In fact, there's an article on the subject. And there's a code:
{
double free_margin=AccountFreeMarginCheck(symb,type,lots);
//-- если денег не хватает
if(free_margin<0)
{
string oper=(type==OP_BUY)? "Buy":"Sell";
Print("Not enough money for ", oper," ",lots, " ", symb, " Error code=",GetLastError());
return(false);
}
//-- проверка прошла успешно
return(true);
}
So if anyone doesn't like something, link to this article.
if you use this function you get a validation errorthere are no trading operations and it is not clear how to get around it