Beginner's questions in MQL5. Professionals don't pass by. - page 6

 
_o0O:

Especially not any, hence it follows that any questions are only welcome.

The help does not contain this nuance. DRAW_NONE does not work either #property or in PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_NONE), PlotIndexSetString(0, PLOT_LABEL, "Buff") does not work either, so what is the logic behind specifying clrNONE to achieve this goal?

Also, not everyone can read the language documentation.

The presented code has everything to check and understand.

 
Alexey Viktorov:

Also, not everyone knows how to read the language documentation.

The code provided has everything you need to check and understand it.

Do you want to talk?

OK. Please show me the place in help where there is a solution to my problem. And your code is a crutch, undocumented feature, as specifying clrNONE not to render the buffer looks delusional.

 
Alexey Viktorov:

You don't need to put DRAV_NONE type, but clr_NONE colour.

Here is the test code

Explain:

limit = rates_total-prev_calculated; // Это тупо для примера. В нормальном индикаторе так делать нельзя!

Why can't you? Why in red with an exclamation?

 
_o0O:

How can I make some indicator buffers not be drawn on the chart, but display their values in the"Data window" of the indicator?

I do so:


but still the indicator draws a buffer.

You can see an example here:

3TF_RSI_Average
3TF_RSI_Average
  • www.mql5.com
Индикатор Three timeframes RSI Average - отображает в отдельном окне три индикатора Relative Strength Index с заданных таймфреймов и их среднее значение. Имеет десять настраиваемых параметров: RSI period - период расчёта RSIOverbought - уровень перекупленностиOversold - уровень перепроданностиDrawing mode - режим рисованияFirst RSI timeframe...
 
Artyom Trishkin:

You can see an example here:

No, that's not it.

In your example, 4 buffers are drawn and 4 are in the data window. what is needed is for them not to be drawn, but to be in the data window and have a given name.

 
_o0O:

No, that's not it.

In your example, 4 buffers are drawn and 4 are in the data window. What is needed is that they are not drawn, but are in the data window and have a given name.

And if you look attentively? There is a disabling of displaying three of four buffers - one by one. But when disabled in the data window, they continue to be displayed, and with programmatically given names - everything as asked. Or did I misunderstand the question?

 
Artyom Trishkin:

How about a closer look? There is an option to disable the display of three of the four buffers - one at a time. But when you turn them off, they are still displayed in the data window, and with the programmed names - just as you asked. Or did I misunderstand the question?

Yes, I see there

PlotIndexSetInteger(0,PLOT_DRAW_TYPE,InpShowRSI1);

InpShowRSI1 takes values 0 or 1, that's how it works.

But I specified PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_NONE); and it doesn't work

 
_o0O:

yes, I can see there

PlotIndexSetInteger(0,PLOT_DRAW_TYPE,InpShowRSI1);

InpShowRSI1 takes values 0 or 1, that's how it works.

But I specified PlotIndexSetInteger(0,PLOT_DRAW_TYPE, DRAW_NONE); and it didn't work

DRAW_NONE == 0

DRAW_LINE == 1

So you have something else somewhere. In theory, it should work for you too.

 
Artyom Trishkin:

Explain:

Why can't you? Why in red with an exclamation?

If the indicator will calculate multiple bars, such implementation will fly outside the array. So you have to strain your head muscles in each case...
 
Alexey Viktorov:
If the indicator will calculate several bars, such implementation will fly outside the array. Therefore, in each case we must strain our head muscles.

No, you don't have to. Everything is done once at limit>1. This is first run and history loading. And if you have smoothing period_sm=10, then limit in this case should be less by 10. Accordingly:

if(limit>1)
  {
   limit=rates_total-period_sm-1;
   ArrayInitialize(Buffer,InitValue);
  }

InitValue - value to initialize the buffer - 0 or EMPTY_VALUE - as appropriate. Or maybe -100500 ...

Reason: