Removed the while loop, I get the first line like this
Please tell me what is wrong.
We have to check what we get in the str_dat1 variable
Actually, the iBarShift should pass a date of datetime type, not a string. Maybe it accepts a clean string as a date, while it won't accept a variable.
It's better to convert received string into datetime type.
ps And a completely crazy idea to test it by writing
int shift=iBarShift(Symbol(),PERIOD_D1, (string)str_dat1);
The bar graph is set correctly if the date is written like this
but it is not set if I write it like this
The date(str_dat1) is printed correctly.
What isthe reason?
The reason is that the iBarShift() function must pass the datetime variable type, while you pass a String type.
datetime str_dat1=StringToTime(StringSubstr(str,0,10));// это датаdouble str_b1=StringToDouble(StringSubstr(str,12,6)); // это значениеint shift=iBarShift(Symbol(),PERIOD_D1,str_dat1);
Range_Buffer[shift]=str_b1;
I have a question how to build a histogram on all lines of the file.
I found in help, that the jump to the next line is FileSeek()
But I don't know how to skip to the next line.
So far puts only one column
Help )
If you open the file before the loop and do not close it until the end, with each iteration of the loop the next line will be read. And you can close the file after the loop ends.
FileSeek() moves a pointer not to the next line but by the specified number of bytes from the beginning, from the end of the file, or from the current pointer position.
To move it correctly, you need to know how many bytes one line takes up in the written file.
If you open the file before the loop and do not close it, the next line will be read with each iteration of the loop. And you can close the file after the end of the loop.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Do you have one entry corresponding to one bar or not?
Yes, it will be one bar of the histogram on PERIOD_D1 on the bar on the twenty-ninth of March.
29.03.2017. 574391
The bar graph is set correctly if the date is written like this
but it is not set if I write it like this
The date(str_dat1) is printed correctly.
What isthe reason?Removed the while loop, I get the first line like this
Please tell me what is wrong.
We have to check what we get in the str_dat1 variable
Actually, the iBarShift should pass a date of datetime type, not a string. Maybe it accepts a clean string as a date, while it won't accept a variable.
It's better to convert received string into datetime type.
ps And a completely crazy idea to test it by writing
But this is purely counting on mql4 optionality.
The bar graph is set correctly if the date is written like this
but it is not set if I write it like this
The date(str_dat1) is printed correctly.
What isthe reason?The reason is that the iBarShift() function must pass the datetime variable type, while you pass a String type.
...
It's better to convert received line to datetime type.
Thank you, puts up a bar graph.
I have a question how to build a histogram on all lines of the file.
I found in help, that the jump to the next line is FileSeek()
But I don't know how to skip to the next line.
Thank you, puts up a bar graph.
I have a question how to build a histogram on all lines of the file.
I found in help, that the jump to the next line is FileSeek()
But I don't know how to skip to the next line.
So far puts only one column
Help )
If you open the file before the loop and do not close it until the end, with each iteration of the loop the next line will be read. And you can close the file after the loop ends.
FileSeek() moves a pointer not to the next line but by the specified number of bytes from the beginning, from the end of the file, or from the current pointer position.
To move it correctly, you need to know how many bytes one line takes up in the written file.
Thank you, puts up a bar graph.
I have a question how to build a histogram on all lines of the file.
I found in help, that the jump to the next line is FileSeek()
But I don't know how to skip to the next line.
So far puts only one column
Help )
The reason is that the iBarShift() function needs to pass the datetime variable type, while you pass the string type, try this
...
Thanks, I will do so.
If you open the file before the loop and do not close it, the next line will be read with each iteration of the loop. And you can close the file after the end of the loop.
It works, thank you.
I gave you a link to an article that describes it all with examples. Didn't seem to read it...
I read it, but I would never have guessed to open the file before the loop )
Probably didn't read it carefully )