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

 

It is written in the tutorial:
If FILE_WRITE is not combined with FILE_READ, a file of zero length will be opened. Even if there was data in the file before it was opened, it will be destroyed. If you want to append data to an existing file, you have to open it using the FILE_READ | FILE_WRITE combination.

I use this

int handle=FileOpen(Symbol()+".csv",FILE_CSV|FILE_READ|FILE_WRITE,"\t");

I see in the file that there is always only the latest data, i.e. the information is overwritten. How can I make the information be added?

 
Can you tell me how to do this: when the zero bar appears and the first value of the indicator works on the zero bar, you have to fix this value, so that when the zero bar closes it remains the same as when it was opened.
 
LuRAS:
Pro, please advise how to do this: when the zero bar has just appeared and, respectively, the first value of the indicator that works on the zero bar, we need to fix this value, so that after closing the zero bar it remains the same as when it opens.

Let's save the time of the last bar opening in the variable Time[0]. If the value in this variable is not equal to the one in Time[0], it means that the first tick of the new bar has come. At this point, we store the value of our indicator on the zero bar. Then, as soon as the value in our variable is no longer equal to that in Time[0], the Expert Advisor will understand that a new bar has been reached again. At this point, it understands that the indicator variable contains the indicator value corresponding to the open point of the previous bar. It can use this value somehow and then return the indicator value to the indicator variable (it is a new candle and it is the first tick of a new candle).
 
It means that we should modify the indicator and make an EA? Can't you make a template and insert your indicator into it through icustom?
 
LuRAS:
It means that we should modify the indicator and make an EA? Can't you make a template and insert your indicator into it through icustom?


The indicator is not needed to send quotes into a text document. An Expert Advisor is enough. And vice versa, the Expert Advisor is not needed, if the indicator sends quotes to the text document.
 

The opening time of the current trading session can be obtained from:

iTime(NULL,PERIOD_D1,0)

- And how can we find out as accurately as possible the opening time of the next trading session, while we are still in the current one?

Thank you!

 
chief2000:

The opening time of the current trading session can be obtained from:iTime(NULL,PERIOD_D1,0)

- And how to get the most accurate information about the opening time of the next trading session, while we are still in the current one?

Thank you!


iTime(NULL,PERIOD_D1,0)+24*60*60

)))

But it obviously has nothing to do with "trading sessions".

 
Figar0:

)))

Except that it clearly has nothing to do with "trading sessions".

That's exactly what I'm applying now, but "it turned out" that there are shortened sessions and this solution pops into the next one, but not at the very beginning of it, but a bit further away. Maybe there's some other way?

Thanks!

 
chief2000:

This is exactly what I'm applying now, but "it turns out" that there are shortened sessions and this solution slips into the next one, but not at the very beginning of it, but a bit further on. Maybe there is some other way?

Thanks!

https://www.mql5.com/ru/forum/132894/page12#464927
Reason: