Errors, bugs, questions - page 1388

 

An error in logic

If the request to place an order was declined (line with failed) due to lack of network connectivity, why was it actually executed, which is confirmed by the subsequent modification of the order (line with modify).

And if after the network connection was re-established the terminal itself sent a second request, where is the line about its successful execution?

 
A100:

An error in logic

If the request to place an order was declined (line with failed) due to lack of network connectivity, why was it actually executed, which is confirmed by the subsequent modification of the order (line with modify).

And if after the network connection was re-established the terminal itself sent a second request, where is the line about its successful execution?

The broker did not want to execute your order and disconnected the Internet. But then the market conditions have changed and the broker changes his mind and executes the order. ))
 
Sergey Chalyshev:
The broker did not want to execute your order and disconnected the internet. But then market conditions changed, he changed his mind and executed. ))
The crux of the problem is that the software does not properly record the changes that take place, making it impossible to refer to the logbook in case of a disagreement with the broker.
 

Can you tell me why FileOpen function does not work in INI_file::WriteFile. It returns -1. GetLastError() returns code 5004 (File can not open)

void INI_file::WriteFile(string &lines[])
  {
   string fn=IniName;
   //int fh=FileOpen(fn,FILE_WRITE);
   int fh=FileOpen(fn,FILE_WRITE|| FILE_TXT ||FILE_ANSI);
   if(INVALID_HANDLE==fh)
     {
      LastErr=GetLastError();
      Message=StringConcatenate("FileOpen(...) of ",IniName,": ",ErrorDescription(LastErr));
      return;
     }

   for(int i=0;i<ArraySize(lines);i++)
      FileWriteString(fh,lines[i]+"\n");

   FileClose(fh);
  }

void INI_file::ReadFile(string &lines[])
  {
   int fh=FileOpen(IniName,FILE_READ || FILE_TXT || FILE_ANSI);
   if(fh==INVALID_HANDLE)
     {
      LastErr=GetLastError();
      Message=StringConcatenate("FileOpen(...) of ",IniName,": ",ErrorDescription(LastErr));
      return;
     }

   string line="";

   int k=0;
   ArrayResize(lines,1000);
   while(!FileIsEnding(fh))
     {
      line=FileReadString(fh);
      lines[k++]=line;
      if(k==ArraySize(lines))
         ArrayResize(lines,1000+k);
     }

   ArrayResize(lines,k);
   FileClose(fh);
  }

Requires re-creation of a text file in ansi-encoding. Before callingWriteFile I read the same file with INI_file::ReadFile.

 

I am talking about MT4 and MQL4.

Sometimes data are opened normally and written (return value ofFileWriteString is not checked), but file is not changed, even file date is not changed.

 int fh=FileOpen(fn,FILE_WRITE);

If I open file in this way, the file is opened and data are written in ansi-encoding, but not unicode, as described in the Help, when FILE_ANSI/FILE_UNICODE is absent.

 
Дмитрий:

Can you tell me why FileOpen function does not work in INI_file::WriteFile. It returns -1. GetLastError() returns code 5004 (File can not open)

   int fh=FileOpen(fn,FILE_WRITE | FILE_TXT | FILE_ANSI);
 
A100:
Thank you! Haven't written in MQL for a long time ))). Forgot
 

Can anyone explain why a tester would download a story on a tool that I am not going to test?

downloading EURUSD

the tool for testing USDCAD, there are no requests to work with EURUSD

and this happens all the time, is it trying to make synthetic pairs out of what it has if there are gaps in the history? I can't find any other explanation.

 
The tester is multi-currency and needs to calculate absolutely precisely at any second both margin requirements and profits in the deposit currency.

This is why the trading strategy tester calculates all interrelations of financial instruments and provides accurate modelling of market conditions.
 
Renat Fatkhullin:
The tester is multi-currency and needs to calculate absolutely precisely at any second both margin requirements and profits in the deposit currency.

This is why the trading strategy tester calculates all interrelations of financial instruments and provides accurate simulations of market conditions.
Thanks for the clarification, as long as it is necessary, let him download it, I don't feel sorry)