[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 307

 

artmedia70, thank you for your help, you have already helped me out twice, I hope you will continue to help! ))

 
Sancho77:

artmedia70, thank you for your help, you have already helped me out twice, I hope you will continue to help! ))

You're welcome, especially if I don't know what you mean... :D
 

Please suggest the code below for reading a log file. Automatically reads the current log file by date and outputs it to the printer.

Where:

while (result>0) {

The file is being assembled from parts. But I don't need the whole file, just the last line. Help to correct, please.

void ReadWrite() {
   string tekTime=TimeStr1(CurTime(),1);
   string path=TerminalPath()+"\\logs\\"+tekTime+".log";
   string title="Чтение из файла";
   string msg;
   int result;
   int handle=_lopen(path,4);
   if (handle<0) {
      msg="Ошибка открытия файла";
      //MessageBox(msg,title,MB_OK|MB_ICONERROR);
      Print(msg);
      return;
   }
   result=_llseek (handle,0,0);
   string buffer="";
   //string char="x                      ";
   string char="x                                                                                                                                                                                                                                                         ";
   int count=0;
   result=_lread (handle,char,250);
   while (result>0) {
      buffer=buffer+char;
      char="x                                                                                                                                                                                                                                                         ";
      count++;
      result=_lread (handle,char,250);
   }
   result=_lclose (handle);
   msg=StringTrimRight(buffer);
   //MessageBox(msg,title,MB_OK|MB_ICONINFORMATION);
   Print(msg);
}

//------------------расчет времени----------------
string TimeStr1(int taim,int tip)
{
   string sTaim;
   string sTaim1,sTaim2,sTaim3;
   if (tip==1) 
   {
      int GD=TimeYear(taim);                  
      int MN=TimeMonth(taim);                  
      int DD=TimeDay(taim);  
      
      sTaim1 = DoubleToStr(GD,0);
      if (MN<10) sTaim2 = StringConcatenate(sTaim2,"0"+DoubleToStr(MN,0));
      else sTaim2 = StringConcatenate(sTaim2,DoubleToStr(MN,0));
      if (DD<10) sTaim3 = StringConcatenate("0",DoubleToStr(DD,0));
      else sTaim3 = DoubleToStr(DD,0);
      sTaim=sTaim1+sTaim2+sTaim3;
   }
   return(sTaim);
}
 

Please advise on the picture from the magazine.

It turns out that for five hours the terminal did not see the account ???? and therefore the advisor did not work ????

 
Vinin:


To speed up the calculation, it is better to do it a little differently

Dividing takes a long time. It is better to do it once.

That's great! Thank you!
 
renoshnik:

Please advise on the picture from the magazine.

It turns out that for five hours the terminal did not see the account ???? and therefore the advisor did not work ????

I think you had no internet connection. The f4u has frequent interruptions, but I've only noticed them for a few minutes. But that's my personal opinion, maybe the experts can tell you something.
 
renoshnik:

Please advise on the picture from the magazine.

It turns out that for five hours the terminal did not see the account ???? and therefore the advisor did not work ????

It's actually the requotes. After login the error started to appear, nothing has initialised yet... So the connection to the account failed?...I usually have all sorts of indicators and EAs initialised after login and then trading errors, if any. Conclusion - no connection established, like forexnew wrote. Well, yes, the terminal didn't see the account.
 

Good evening, please advise. There are two indicator values on different bars. How to draw a line through them and how to work with it in the indicator? Thanks!

 

after how long does a MODE_TRADE pending order become MODE_HISTORY?

 
vilard:

after how long does a MODE_TRADE pending order become MODE_HISTORY?


I think when it fills and closes as well as when it is released.