Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 880
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
the robot only stands on this chart but trades the same options as they do for robots
Insert this line.
put
but I don't think resetting the error will help.
but I don't think resetting the error will help.
Also.
I already did that and it worked.
But the fact of the error is still unresolved.
thanks so much for your help
while(eror==false&&step<10)
{
double bid=SymbolInfoDouble(symbolName,SYMBOL_BID);
ResetLastError();
eror=Trade.Buy(lot,symbolName,bid,0,0,comment);
step++;
Sleep(200);
if(eror==false)
{
Print("error - ",GetLastError());
if(GetLastError()==4754){OnInit();}
}
}
the fact of the error is unresolved.
That's why I suggested this option.
That's why I suggested this option.
Well, I'll give it a try.
But why doesn't the standard class work?
Well, I'll give it a try.
But why doesn't the standard class work?
If the alternative library works, it will become clear where to dig.
I can't reproduce the problem with each of the libraries.
I already did this and it worked.
while(eror==false&&&step<10)
{
double bid=SymbolInfoDouble(symbolName,SYMBOL_BID);
ResetLastError();
eror=Trade.Buy(lot,symbolName,bid,0,0,comment);
step++;
Sleep(200);
if(eror==false)
{
Print("error - ",GetLastError());
if(GetLastError()==4754){OnInit();}
}
}
This should not work. 4754 occurs when OrdersTotal is greater than zero, but OrderSelect or OrderGetTicket get screwed up.
This is very rare, but not in this case. The server/symbol is so specific here that the same thing happens with positions, only with error 4753.
Already prepared to have to make adjustments to the alternate bible, as the situations that arise pull a lot of logic down. For there you send a market order, it comes to the server, creates a position and closes it at the same millisecond. And the terminal receives information retroactively because of the ping.
I was pleasantly surprised that everything worked perfectly.
Server/symbol itself dodosil, error did not occur.
SZY The pose cannot be opened manually, only through MQL.
I meant that it helped that the robot didn't hang
I meant that it helped the robot not to hang
Then show OnInit. Right now it looks like nonsense.