Errors, bugs, questions - page 2489

 
Slava:

Oh, by the way, OnCalculate has the rates_total parameter

In OnCalculate the rates_total parameter also shows more than what is configured in the terminal.

 
Alexey Viktorov:

In OnCalculate the rates_total parameter also shows more than what is set in the terminal.

rates_total always shows the number of bars available on the current chart.

I don't understand the meaning of your statement.

 

I don't have a client terminal handy at the moment to quote the help. From a mobile device in two clickshttps://www.metatrader5.com/ru/terminal/help/startworking/settings#max_bars

Specially highlighted paragraph

For more economical calculation indicators may have more bars available than specified in "Max bars in window" parameter. As new bars arrive, older bars are not immediately removed from the data cache. This allows not to recalculate the indicator completely at each new bar, but only to additionally calculate its values for new bars.

Настройки платформы - Начало работы - MetaTrader 5
Настройки платформы - Начало работы - MetaTrader 5
  • www.metatrader5.com
Торговая платформа обладает множеством настроек, что позволяет организовать работу в ней так, как это удобно именно вам. Выполните команду " Настройки" меню "Сервис" или нажмите "Ctrl+O". Графики — общая настройка отображения ценовых графиков, а также настройка параметров управления объектами: выделение объектов после их создания, немедленная...
 
Slava:

rates_total always shows the number of bars available on the current chart.

I do not understand the meaning of your statement

Sorry, the answer is in pictures.

But in the debugger it shows

And you have to scroll through 1268 bars to check the indicator value. Only after that you can check which values of high and/or low as well as open/close bar are used in the indicator calculations.

It's just very uncomfortable. But one quickly gets used to it and adjusts to everything that is not good.

 

Compilation errors expected

class A { public:
        void operator[]( int = 1 ) {} //нормально ???
};
void OnStart()
{
        A a;
        a[]; //нормально ???
}
 
Alexey Viktorov:

Sorry, the answer is in pictures.

But the debugger shows

And to check the value of the indicator we have to scroll through 1268 bars. Only after that you can check which values of high and/or low as well as open/close bar are used in the indicator calculations.

It is just very inconvenient. But one quickly gets used to it and adjusts to everything that is not good.

Have you carefully read my quote in the post below?

This behaviour has always been there since the introduction of the "maximum number of bars on chart" setting , i.e. since the beginning of MT4. And we have explained many times over these 15 years why we do not cut the number of bars according to this setting every time. And now we don't cut back every time.

Nobody reads the documentation. But there's a paradox. Still they ask us to write something else in the documentation, which they don't read.

 
Slava:

1. Where does the documentation need to be updated?

2. The single digit identifier of a bar has always been the bar time, not the bar number.

3. if your chart was called by someone to ChartSetSymbolPeriod, you would easily catch a change in the number of bars. Surprise?

4. By the way, there is parameter rates_total in OnCalculate.

1. exactly where you pointed out in the subsequent post. Just add that there will be a RESET, and this reset will be exactly through the max bars in the window + 1439.

2. Ok, I'll take that into account. Although, you do realise that there can't be two bars under the same time, right?

3. not a surprise. I'm talking specifically about the fact that if you don't change either the timeframe or the symbol, there could be a reset from 6439 to 5000.

4. If you read my post above carefully you will have noticed that:

Forum on trading, automated trading systems and testing trading strategies

Bugs, bugs, questions

Alexey Kozitsyn, 2019.06.28 10:40

Dear developers. If i want to ask you, is automatic repartitioning of indicator buffers normal? By re-partitioning I mean the following: max bars in the window, e.g. 5000. Buffer size + rates_total are reset to 5000 when they reach 6439. The same happens when max bars in window = 10000. Reset occurs at 11439.

Because of this the indicators may crash and show incorrect data.

Build 2085. I have noticed this behavior since about 2000 builds.

I pointed to rates_total also. The problem is that rates_total and buffers are not reset to 0 (would not be a problem then, just recalculate the entire indicator and that's it). And takes the value of max bars in the window. That's exactly what you should just write about.

To make your task easier, I would like to see such a record:

For a more economical calculation, the indicators may have more bars available than specified in the "Max bars in window" parameter. As new bars arrive, older bars are not immediately removed from the data cache. This does not allow the indicator to be recalculated completely at each new bar, but only to add its values to the new bars. Old bars are deleted once the value of Max bars in the +1439 bars window is reached.

Yes, by the way, please clarify, is the value 1439 saved for other TFs as well? Or only for M1?

 
Slava:

Have you carefully read my quote in the post below?

This behaviour has always been there since the introduction of the "maximum number of bars per chart" setting , i.e. since the beginning of MT4. And we have explained many times over those 15 years why we do not cut back the number of bars according to that setting every time. And now we don't cut back every time.

Nobody reads the documentation. But it's a paradox. Still they ask us to write something else in the documentation, which they do not read

Here you talk about "paradoxes" with reading documentation. And I have noticed more than once that you have paradoxes with reading posts. You just often don't read them all the way through. We all have our shortcomings. Only it is better to focus not on other people's shortcomings, but on the shortcomings of the product you develop and we use.

Thank you.

 
Alexey Kozitsyn:

I pointed to rates_total as well. The problem is that rates_total and buffers are not reset to 0 when rates_total and buffers are re-partitioned.

the reference is not correct, it is misleading, I wrotehttps://www.mql5.com/ru/forum/304239/page57#comment_11519307

In MQL5 the buffers in general work as usual arrays, in MT4 the terminal dealt with buffers somehow - it reset them to EMPTY_VALUE, then ... I don't remember where I wrote about the difference between MT5 and MT4 indicators

You need to clear the buffers - you clear them as a usual array, the terminal only sets the size of the array-buffer itself.

Новая версия платформы MetaTrader 5 build 2007: Экономический календарь, MQL5-программы в виде сервисов
Новая версия платформы MetaTrader 5 build 2007: Экономический календарь, MQL5-программы в виде сервисов
  • 2019.04.30
  • www.mql5.com
21 февраля 2019 года будет выпущена обновленная версия платформы MetaTrader 5...
 
Igor Makanu:

The reference is not correct, it is misleading

That is the point, it is better to change the documentation once to correct, complete and up to date, than to explain the same thing for 15 years to different people who have not found something in the documentation.

Reason: