Errors, bugs, questions - page 1398

 
Is there any way to make sure that the CopyBuffer of the indicator from the older TF returns a value exactly on the date that the CopyTime of that TF points to, with the same offset?
 

Compile error:'=' - structure has objects and cannot be copied

struct S1 {       int s1; };
struct S2 { const int s2; };

void OnStart()
{
        S1 a;
        S2 b;
        a = b;
}
and if for example
struct S2 {       uint s2; };
then it's ok. What's the difference?
 
Ilya Malev:
Is the error present in real time? Or only in the tester?
 
Tapochun:
Is the error present in real time? Or only in the tester?
I deleted the post, because I made a fool of myself. I should have used BarsCalculated instead of CopyBuffer.
 
Ilya Malev:
Is there any way to make sure that the CopyBuffer of the indicator from the older TF returns the value on the date, to which the CopyTime of this TF indicates the same shift?

The problem is also solved by BarsCalculated. If BarsCalculated by the indicator is less than SeriesInfoInteger(...SERIES_BARS_COUNT), it means that the indicator has not had time to calculate on the higher TF.

It's good that such a function exists and works :)

 

is there such a character in the German alphabet?

"d", "z".

 
Alexandr Bryzgalov:

is there such a character in German in the alphabet?

"d", "z".

Set the operating system to German locale for non-unicode applications
 
Ilya Malev:

The problem is also solved by BarsCalculated. If BarsCalculated by the indicator is less than SeriesInfoInteger(...SERIES_BARS_COUNT), it means that the indicator has not had time to calculate on the higher TF.

It's good that such a function exists and works :)

Have you tried to analyze the parameter prev_calculated?

int OnCalculate (const int rates_total,      // размер входных таймсерий
                 const int prev_calculated,  // обработано баров на предыдущем вызове
...
 
A100:

Compilation error:'=' - structure has objects and cannot be copied.

But if for example it's ok. What's the difference?

int is constant and is not initialized.

Usuallyconst is initialized at compilation stage, i.e. assign immediately at declaration. But in case of the structure in MQL, I don't know what to do here. C++ gives an error that the variable is not initialized.

Usually you don't add constant variables to a structure.

 

mql4 question:

I can't write some characters in the order comment? For example, I write

string comm="Extremum DC && KF";

really writing Extremum DC _KF in the commentary

if write

string comm="Extremum DC & KF";

does Extremum DC KF spell "real" in the commentary?

What other icons and their combinations are replaced with other characters? The thing is, I sometimes write my working information in the comment.

Some characters are used to find it in the string, e.g. #, $, %

Reason: