Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 401

 
STARIJ:
Searched, searched... Looks like just overwrite the right number of bytes into a new file. Then delete the old one and rename the new one. Also there is FileSeek function - it allows you to move pointer in the file to start writing new information from a certain place

Hi, I've found your indie. Please explain what the code means.

 int y=int(yy);
  int O;
Files:
45.mq4  3 kb
 
Artyom Trishkin:

You did it badly. Reload the terminal after setting the number of history bars. And set there, for example, a million bars - you will have the history from the year one thousand nine hundred and seventy.


Here's putting in and reloading, history until October 20

Files:
yb9y5e.PNG  9 kb
 
RomanRott:

Hi, I've found your indy. Please explain what the code int y=int(yy); int O means;

Let's comment out // int O; and try to translate. It generates an error. See - you need to declare this variable.

What does int y=int(yy); - yy is of double type and then you need an int value. int(yy) is a conversion to int. You can write (int)yy. And anyway, this is an Expert Advisor

 
RomanRott:

Here I put it in and reloaded it, history until 20 October

And in the window how many bars do you have? This is what the chart will show.

 
STARIJ:

Let's comment out // int O; and try to translate. It generates an error. You see - we need to declare this variable.

What does int y=int(yy); - yy is of double type, and then you need int value. int(yy) - conversion to int. You can write (int)yy. And anyway, this is an Expert Advisor


But why didn't it do that with 'x'?
And do I understand correctly that the const long &x, const double &yy parameters contain the event coordinates?

 
Artyom Trishkin:

And in the window, how many bars do you have? This is what the graph will show.


It was 65000 in the window, and was displayed until October 20, although from October 20 to today about 100k minutes
I also maxed out the number of bars in the window, history to October 20

 
RomanRott:

Stood 65000 in the window, and was displayed until October 20, although from October 20 to today about 100k minutes
I also maxed out the number of bars in the window, history until Oct 20

F2, and load all the quotes by the right symbols. Starting with M1, and ending with the month.

 
RomanRott: Why isn't this done with 'x'?

And do I understand correctly that const long &x, const double &yy contain event coordinates?

this is also done with 'x': ChartXYToTimePrice(0, int(x).......

that the const long &x, const double &yy parameters contain: click on OnChartEvent and press F1. Below is a small table. In the big table below, find the Click Event on a graphical object and read it. And press F1 more often.

 
STARIJ:

this is also done with 'x': ChartXYToTimePrice(0, int(x).......

what const long &x, const double &yy parameters contain: click on OnChartEvent and press F1. Below is a small table. In the big table below, find the Click Event on a graphical object and read it. And press F1 more often


I meant why with y in the code is written and with x already as a parameter
Very informative on the right

const long& lparam,   // параметр события типа long 
const double& dparam, // параметр события типа double 
 
RomanRott:

I meant why with y in the code is written and with x already as a parameter
Very informative on the right

What difference does it make where to convert? The help below is this:

Mouse click event on graphical object

CHARTEVENT_OBJECT_CLICK

X coordinate

Y coordinate

Name of the graphical object where the event occurred

Reason: