Errors, bugs, questions - page 617

 

Where are the first eight hours of Monday?

 
Disco:

+ If you minimise the terminal during the test and then maximise it afterwards, I get something like (collapses the quotation window):

Build 567, terminal - Alpari (since 565 were these glitches), WinXP SP3 (32bit), demo account in Alpari - ruble.

 

build 567

Constant information about lack of memory. This was not the case before.

Drop down calendars (beginning and end of testing period) close 0.5 seconds after opening.

Initial deposit is constantly reset to 10000.

 
notused:
Disco:

Bild 567, Alpari terminal (there were these glitches with 565), WinXP SP3 (32bit), Alpari demo account - ruble.

Also, the moment the lines become empty, SymbolInfoTick(Symbol(), tick) returns zeros in tick.bid and tick.ask.

+ zeros are displayed in the window to open/close/modify orders and positions.

Apparently the problem is in Alpari's ruble account (or maybe it's because of the glass), because I opened terminal from Broco and entered the Alpari demo server there - opened demo ruble account - the "disco" repeated

 

Hello!

Maybe someone has had this problem in MQL5. Sometimes (in about one case out of a hundred) the EA cannot delete a pending order until I manually delete all the pending orders myself. In this case no errors are simply deleted. Or maybe someone else removes them? If anyone is willing to help, if needed I will send you login and password and account number with "caught orders". Thank you in advance.

void OnTick()
{
MqlTradeRequest request;
MqlTradeResult result;
MqlTradeCheckResult checkResult;
//------ delete order ------
request.action=TRADE_ACTION_REMOVE;
//request.order=OrderGetTicket(0);
request.order=8273050; // explicitly specify not to delete everything
if(OrderCheck(request,checkResult))
{
Alert(request.order);
Alert(request.action);
OrderSend(request,result);
}
else
{
Alert("Error: ",checkResult.retcode);
}
}

Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура результатов проверки торгового запроса
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура результатов проверки торгового запроса
  • www.mql5.com
Стандартные константы, перечисления и структуры / Структуры данных / Структура результатов проверки торгового запроса - Документация по MQL5
 

I've got my head all messed up! This simple design doesn't work. The file exists, but it can't be found or opened. Why?!

   string terminal_data_path = TerminalInfoString(TERMINAL_PATH);
   string SymbolsFileName = terminal_data_path + "\\MQL5\\Files\\" + "symbols.txt";
   if(FileIsExist(SymbolsFileName,0)==false) Print("Файл не найден: ",SymbolsFileName);
   int hFile=FileOpen(SymbolsFileName,FILE_READ|FILE_TXT|FILE_ANSI);
   if(hFile < 0)
   {
      Print("Ошибка при открытии файла: ",SymbolsFileName," - ",GetLastError());
      return;
   }
 
Doozer2:

I've got my head all messed up! This simple design doesn't work. The file exists, but it can't be found or opened. Why?!


string SymbolsFileName = "symbols.txt";
 
stringo:

Thank you! The file is now found, but it still won't open. Error when opening the file: 5004. What can it be?

Документация по MQL5: Файловые операции / FileOpen
Документация по MQL5: Файловые операции / FileOpen
  • www.mql5.com
Файловые операции / FileOpen - Документация по MQL5
 
Doozer2:
Thank you! The file is now found, but it still won't open. Error when opening the file: 5004. What can it be?

The file is probably opened by another program and is therefore currently blocked.
 
Rosh:
Most likely this file is opened by another program and therefore is currently locked.

No, it's a simple text file with one line inside, not opened anywhere else.

I just want to read one line from the file as an example. But it doesn't work!

What's interesting, if I set theFILE_READ flag, the error is 5004,

and if FILE_READ|FILE_WRITE, the file opens without errors (but still no line can be read from it).

I don't understand anything...

Here's the whole code:

   string SymbolsFileName = "123.txt";
   if(FileIsExist(SymbolsFileName,FILE_COMMON)==false) { Print("Файл не найден: ",SymbolsFileName," - ",GetLastError()); return; } else Print("Файл найден: ",SymbolsFileName);
   ResetLastError();
   int hFile=FileOpen(SymbolsFileName,FILE_TXT|FILE_ANSI|FILE_READ|FILE_WRITE);
   if(hFile==INVALID_HANDLE)
   {
      Print("Ошибка при открытии файла: ",SymbolsFileName," - ",GetLastError());
      return;
   }
   else Print("Файл открыт успешно: ",SymbolsFileName);
   FileSeek(hFile,0,SEEK_SET);
   Print(FileReadString(hFile));
   FileClose(hFile);
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы ввода/вывода / Флаги открытия файлов - Документация по MQL5
Reason: