Download MetaTrader 5

With usability and efficiency in mind: what is an optimal number of buffers in a scalable indicator?

To add comments, please log in or register
Stanislav Korotky
23364
Stanislav Korotky  
  • 40%
    (6)
  • 13%
    (2)
  • 13%
    (2)
  • 7%
    (1)
  • 27%
    (4)
Total voters: 15
Stanislav Korotky
23364
Stanislav Korotky  

Number of indicator buffer is unlimited. There exist indicators, implemented in a generalized scalable way (for example, multicurrency, multiperiod), which can handle an arbitrary number of buffers. AFAIK, MQL does not allow us at the moment to specify number of buffers dynamically, as input parameter - that would make this question trivial.

Currently, a developer must choose a specific limit and hardcode it in the product. If this is a fairly large number, useless memory consumption will increase (because most of users will leave excessive buffers idle), charts could become a mess of lines, and Data Window will be populated with a lot of empty rows.

So, which is an optimal number of indicator buffers? The question is about visible buffers, not about internals.

Marco vd Heijden
Moderator
6152
Marco vd Heijden  

As much as you need and probably more.

Stanislav Korotky
23364
Stanislav Korotky  
Marco vd Heijden:

As much as you need and probably more.

This is not about me, this is about users. A generalized indicator will be used for different use-cases.

Alain Verleyen
Moderator
35129
Alain Verleyen  
Stanislav Korotky:

Number of indicator buffer is unlimited. There exist indicators, implemented in a generalized scalable way (for example, multicurrency, multiperiod), which can handle an arbitrary number of buffers. AFAIK, MQL does not allow us at the moment to specify number of buffers dynamically, as input parameter - that would make this question trivial.

Currently, a developer must choose a specific limit and hardcode it in the product. If this is a fairly large number, useless memory consumption will increase (because most of users will leave excessive buffers idle), charts could become a mess of lines, and Data Window will be populated with a lot of empty rows.

So, which is an optimal number of indicator buffers?

Maximum number of buffers is 512.

About your topic, I don't really understand what you are asking. There is no general answers, it depends of the needs (what indicator) and the resources available (what computer, memory). An other problem is we don't have control on buffers, if the platform settings are 5,000 or 65,000 or 100,000,000 bars on a chart, it's very different. A lot of improvement could be done, but I have no idea if Metaquotes want to do invest in such advanced features.

On an other side, I don't see clearly what could be the advantages a "generalized scalable" indicator(s) ? Do you have example(s) ? Of course the code could be generalize and scalable but isn't better to just compile different versions with just needed buffers ?

Stanislav Korotky
23364
Stanislav Korotky  
Alain Verleyen:

Maximum number of buffers is 512.

About your topic, I don't really understand what you are asking. There is no general answers, it depends of the needs (what indicator) and the resources available (what computer, memory). An other problem is we don't have control on buffers, if the platform settings are 5,000 or 65,000 or 100,000,000 bars on a chart, it's very different. A lot of improvement could be done, but I have no idea if Metaquotes want to do invest in such advanced features.

On an other side, I don't see clearly what could be the advantages a "generalized scalable" indicator(s) ? Do you have example(s) ? Of course the code could be generalize and scalable but isn't better to just compile different versions with just needed buffers ?

According to this documentation page - "No limit for the number of indicator buffers" in MT5. Probably there is an error in some place.

I'm speaking about products for the Market, so it's not possible to compile a special version for everyone - there should be a single production version for majority of users and without much overheads. I can not manage user's computer memory and chart settings, so they are just some given external preconditions (equal for any number of buffers selected) and go out the scope of indicator development, especially taking into account that they (preconditions) can vary significantly.

I mentioned examples above: multicurrency or multiperiod indicators.

Stanislav Korotky
23364
Stanislav Korotky  
Alain Verleyen:

Maximum number of buffers is 512.

In addition, I don't understand how a human can handle an indicator with 50+ or even 30 lines. Can you provide an example? This is where usability comes into play.

Marco vd Heijden
Moderator
6152
Marco vd Heijden  

Well i have had products rejected from market due to stack overflow's but i always found a solution re-writing the entire thing,

And usually end up ArrayResizing() to the needed number of cells, depending on the number of available instruments for any specific user.

That is very easy.

ArrayResize(array_name,SymbolsTotal(1),0);
Productivity - USA - Fundamental Analysis - Price Charts, Technical and Fundamental Analysis - MetaTrader 5 Help
Productivity - USA - Fundamental Analysis - Price Charts, Technical and Fundamental Analysis - MetaTrader 5 Help
  • www.metatrader5.com
The productivity index measures the output produced for each hour of labor worked. This indicator is useful for predicting inflation and output...
Stanislav Korotky
23364
Stanislav Korotky  
Marco vd Heijden:

Well i have had products rejected from market due to stack overflow's but i always found a solution re-writing the entire thing,

And usually end up ArrayResizing() to the needed number of cells, depending on the number of available instruments for any specific user.

That is very easy.

But you can't change number of buffers dynamically. That's the problem.

Apart from that, you can not resize indicator buffers, and stack overflow means problem in a control flow, not in a data.

Alain Verleyen
Moderator
35129
Alain Verleyen  
Stanislav Korotky:

In addition, I don't understand how a human can handle an indicator with 50+ or even 30 lines. Can you provide an example? This is where usability comes into play.

You can use a lot of buffers just for calculations, they don't have to be available to human user. A customer already asked what was the limit, that's why I know it :-)

Alain Verleyen
Moderator
35129
Alain Verleyen  
Stanislav Korotky:

According to this documentation page - "No limit for the number of indicator buffers" in MT5. Probably there is an error in some place.

I am just saying what is documented :  

The maximum allowed number of buffers in one indicator is 512.

They probably mean with "no limit" that a normal user will never reached the limit.

I'm speaking about products for the Market, so it's not possible to compile a special version for everyone - there should be a single production version for majority of users and without much overheads. I can not manage user's computer memory and chart settings, so they are just some given external preconditions (equal for any number of buffers selected) and go out the scope of indicator development, especially taking into account that they (preconditions) can vary significantly.

What I mean is you maintain 1 code and you compile and sell X indicators.

I mentioned examples above: multicurrency or multiperiod indicators.

These are not concrete examples, why a multicurrency or multiperiod would need a dynamic number of buffers ?

I still don't see any advantages to such approach so I would be happy if you could enlighten me. A general approach is always consuming more resource as needed, and is most of the time slower.

I really can't answer to your poll without knowing exactly what you mean.

12
To add comments, please log in or register