Errors, bugs, questions - page 850

 
papaklass: So you suggest to mark and save all trades for each case, and then compare them with each other. It's a hassle, but it looks like you can't do without it.

That's what I do when I get stuck.

..I also wrote an addition in my previous post.

papaklass : PS: OpenPosition() is not a class method from the standard library, it's just my function that opens positions.

Well, it doesn't change anything. It is executed in different conditions.

 

Please advise howCFileTxt library can write new data into the next line of the file.

#include <Files\FileTxt.mqh>
CFileTxt Txt;
.........

void OnTimer()
 {
   int reshandle=Txt.Open("STScan.csv",FILE_WRITE|FILE_CSV);

       if( reshandle < 1 )
         {Print( "Ошибка открытия файла: " , GetLastError()   );}
       else
         {string text="текст";Txt.WriteString(text);}  

   Txt.Close();
 }

It will overwrite the first line and not write the next one

Thank you

 
Olegts:

Please advise how CFileTxt library can write new data into the next line of the file.

It will overwrite the first line and not write the next one

Thank you

    int reshandle=Txt.Open("STScan.csv",FILE_WRITE|FILE_CSV);

The idea is to do it in OnInit, so it won't overwrite the file

 
Olegts:

Please advise how CFileTxt library can write new data into the next line of the file.

It will overwrite the first line and not write the next one

Thank you


   int reshandle=Txt.Open("STScan.csv",FILE_WRITE|FILE_READ|FILE_CSV);

       if( reshandle < 1 )
         {Print( "Ошибка открытия файла: " , GetLastError()   );}
       else
         {
          Txt.Seek(0,SEEK_END);
          string text="текст";
          Txt.WriteString(text);
         }  

   Txt.Close();
 
uncleVic:

Thanks, doesn't work, keeps overwriting the first line, maybe because there's no carriage translation character, where do I put it here?

It's a pity that the documentation of functions from standard libraries is so bad

Документация по MQL5: Стандартная библиотека
Документация по MQL5: Стандартная библиотека
  • www.mql5.com
Стандартная библиотека - Документация по MQL5
 
Olegts:

Thanks, doesn't work, keeps overwriting the first line, maybe because there's no carriage translation character, where do I put it here?

It's a pity that the documentation of functions from standard libraries is so bad


Txt.WriteString("\r\n");   // запись перевода каретки
 
Olegts:

Thanks, doesn't work, keeps overwriting the first line, maybe because there's no carriage translation character, where do I put it here?

It's a pity that documentation of functions from standard libraries is so bad

Did they do that too?

 int reshandle=Txt.Open("STScan.csv",FILE_WRITE|FILE_READ|FILE_CSV);
 
uncleVic:

Did they do that too?

Thank you all, it's working.
 
Fia:

Good afternoon!

Can you tell me why this code (from help) seems to work (the object is created), but I can't see any text on the chart?

Thank you for your reply.

...
Maybe you have white text on a white background? :)
 
tol64:
Maybe you have white text on a white background? :)

Thank you for your feedback.

I sort of figured it out (that's why I deleted the post).

If the name of the object "vertical line" is the same as the name of the object "text",

I can't see the line I want to display using the object "text", it won't show up.

Although what is the connection here is not clear objects are different (line and text)?

In general, the main thing that works.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов - Документация по MQL5
Reason: