so it could be the wrong length at the Friday-Monday transition (or if there are missed bars in the history)
it is better to read point time and then define bars
datetime time1=(datetime)ObjectGetInteger(ExtChartID,name,OBJPROP_TIME,0);
datetime time2=(datetime)ObjectGetInteger(ExtChartID,name,OBJPROP_TIME,1);
int bar1=iBarShift(_Symbol,_Period,time1);
int bar2=iBarShift(_Symbol,_Period,time2);
so it could be the wrong length at the Friday-Monday transition (or if there are missed bars in the history)
it is better to read the time of the points and then identify the bars
Agreed. Didn't bother myself or my brain. Then it is better to take the number of bars between dates.
intBars(
string symbol_name, // имя символа ENUM_TIMEFRAMES timeframe, // период datetime start_time, // с какой даты datetime stop_time // по какую дату
);
Here the variable is declared and immediately it is divided:
double spred = spred/Point*(tot-1);
The error shows that the compiler treats this variable (spred) as undeclared. This is also at least not good, because it (variable) is not initialized - since it is nota global variable, it may have an undefined value...
Try declaring it earlier and assigning a value to it
Here a variable is declared and immediately it is shared:
The error shows that the compiler treats this variable (spred) as undeclared. This is also at least not good, because it (the variable) is not initialized - since it is not a global variable, there may be an undefined value...
Try to declare it earlier and assign a value to it
Eugene, from the bottom of my heart! It's on, thank you.
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.
Time minus time divided by PeriodSeconds()
so it could be the wrong length at the Friday-Monday transition (or if there are missed bars in the history)
it is better to read point time and then define bars
so it could be the wrong length at the Friday-Monday transition (or if there are missed bars in the history)
it is better to read the time of the points and then identify the bars
Agreed. Didn't bother myself or my brain. Then it is better to take the number of bars between dates.
if(tot > 1)PercCloseDown();
This part says error
Can you tell me how to start the robot?
This part writes an error
How do I get the robot to start?Here the variable is declared and immediately it is divided:
The error shows that the compiler treats this variable (spred) as undeclared. This is also at least not good, because it (variable) is not initialized - since it is nota global variable, it may have an undefined value...
Try declaring it earlier and assigning a value to itHere a variable is declared and immediately it is shared:
The error shows that the compiler treats this variable (spred) as undeclared. This is also at least not good, because it (the variable) is not initialized - since it is not a global variable, there may be an undefined value...
Try to declare it earlier and assign a value to itEugene, from the bottom of my heart!
It's on, thank you.
What to do if in MQL5 ...
... it's been about a minute and the problem is the same. Why so long?
Error 4806 - Requested data not found ... - ...how do I make my EA find it?
if(tot > 1)PercCloseDown();
This part says error
Can you tell me how to start the robot?
How do I catch the out of memory error?
What could be causing this message in the first place?
I've written a program of about 20 thousand lines. I have a lot of different classes, arrays and structures.
Approximately once every two or three days the "out of memory" message pops up.
I don't know how to track down which function is responsible for memory leak.
How do I catch the out of memory error?
What could be causing this message in the first place?
I've written a program of about 20 thousand lines. I have a lot of different classes, arrays and structures.
Approximately once every two or three days the "out of memory" message pops up.
I don't know how to catch it, which function is responsible for memory leak.
Make sure each new has its own delete
That is, only through careful reading of your code. To make reading easier and more fun, you can comment it out :-)
It is also a good idea to write test-case scripts for each class and check leaks inside classes that way.
make sure that each new has its own delete
That is, just by reading the code carefully. To make reading easier and more fun, you can also comment :-)
It's also a good idea to write test-case scripts for each class and check leaks inside classes that way.
New, delete are not used. The class elements are defined at the beginning and I don't recreate them.
Mostly I work with arrays.
What aretest-case scripts ?