Please explain what could be wrong with this function? - page 8

 
Slawa:

If the relevant historical data has timed out, what should the SeriesInfoInteger function return with the SERIES_LASTBAR_DATE request?

And who will check the result of GetLastError()?

Your request to servicedesk is called "An odd if(condition) condition is not fulfilled". (Holy crap! The IF IS NOT WORKING!!!) And it was you who was talking nonsense in that request. You've got it all mixed up in there. Re-read your application again in a calmer state, through the eyes of an outsider.

And no need to get snarky - this is a technical forum and arguments should be intelligently prepared.

The only difference is that I am self-taught and you are programming professionals. I am allowed to be mistaken, to express myself incorrectly and even to talk nonsense sometimes, while you are not.

I admitted my mistake as soon as it was pointed out to me about the timing of the prints. But out of that formed another, specifically this question. The issue of unstable behavior of the function with the SERIES_LASTBAR_DATE identifier.

Why is it so that everything was working properly for weeks and then suddenly this trouble?

And exactly after that you said that my function of defining a new bar cannot work because of

Support Team 2016.06.22 11:31

This function cannot be used repeatedly because of

m_tOld = tNew;

And this despite the fact that the variables are passed by reference and there is a different variable for each period.

bool IsNewBar(string symbol, ENUM_TIMEFRAMES timeframe, datetime &m_tOld)

Is that a professional's answer?


 

A belief in the infallibility of professionals is what ruins us.

That was my answer.

Эта функция не может использоваться многократно из-за

m_tOld = tNew;

With the keen eye of a professional, I instantly saw that the m_tOld class member was being modified in a method of that class.

 
Slawa:

A belief in the infallibility of professionals is what ruins us.

That was my answer.

With the sharp eye of a professional, I immediately saw that the member of m_tOld class is subject to change in the method of this class.

So? Shall we go to the third circle of discussion?

Alexey Viktorov:

The only difference is that I am self-taught and you are programming professionals. I am allowed to be wrong, to express myself inaccurately and even to talk some nonsense sometimes, but you are not.

And this despite the fact that variables are passed by reference and each period has its own variable.

bool IsNewBar(string symbol, ENUM_TIMEFRAMES timeframe, datetime &m_tOld)


Do you continue to insist on this? I repeat, I am self-taught, giving names to variables is unprofessional, I am allowed. You should preferably see this before you see a class member.

What's next? The function is called from one copy of the EA twice in a row at the moment when a new D1 bar appears and so does H1, but in one case, the function sees the appearance of a new bar and does not see it in the other case.

In general, I realized for myself that it's better not to use it, it's more expensive.