Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 877

 

Gentlemen - why is the closing time at this broker 22:59 but not 23:59?


 
Roman Shiredchenko:

Gentlemen - why is the closing time at this broker 22:59 but not 23:59?


That is a question for the broker. Friday closes at 10:59 p.m. for many people

 
Alexey Viktorov:

This is a question for the broker. Friday closes at 10:59 p.m. for many people

spsb.
 

Hello

Sometimes when I open an order the error 4754-Ordernot found appears

That's all the EA hangs because it tries to open an order

Reinstalling the EA helps

To open an order I use class CTrade

any tips on what could be wrong?
 
Hello, why might the EA not trade? In the Strategy Tester it works, but not on a $100 real account. I checked the code and found no problems.
 
Mikhail Rudyk:

Hello

Sometimes when I open an order the error 4754-Ordernot found appears

That's all the EA hangs because it tries to open an order

Reinstalling the EA helps

To open an order, use class CTrade

Can you tell me what it could be?

Code?

 

Well, there's nothing wrong with that.

//========================================================================================
void Open(int lot,string comment)
{
bool eror=false;
int step=0;
if(TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)==1)
{
while(eror==false&&&step<10)
{
double bid=SymbolInfoDouble(symbolName,SYMBOL_BID);
eror=Trade.Buy(lot,symbolName,bid,0,0,comment);
step++;
Sleep(200);
if(eror==false)Print("error - ",GetLastError());
}
}
}

 

let's just say it's a scalper putting in very often

and can work for example an hour or 2 sometimes half an hour all right

and then an error and hangs

 
Mikhail Rudyk:

Well, there's nothing wrong with that.

A bid purchase at the very least.

 
Mikhail Rudyk:

and then an error and hangs

Log before hanging?