Errors, bugs, questions - page 298

 
Urain:

The standard CChart class is glitchy.

Run the script and voila, the chart is blown away by the wind :o)

The chart is deleted without any error messages.

I can recommend that before the script terminates, you call

eur.Detach();

Then the chart will not be deleted.

 
uncleVic:

I can recommend that, before the script terminates, you call

eur.Detach();

Then the chart will not be deleted.

Yes, yes thanks, I already understood from Rashid's post that I need to Detach before exiting
 
Please tell me if several charts (indicators) are considered in one code. How can they be displayed in several different windows (indicators) from the same code (in separate windows under the candlestick chart)?
 
-Alexey-:

Please tell me if there are several charts (indicators) in a single code. How to display them from this one code in several different windows (indicators) (in separate windows under a candlestick chart)?

If "one code calculates several charts (indicators)", then, most likely, indicator buffers for each of these indicators are calculated in the same code. To output the values of indicator buffers in "several different windows (in separate windows below the candlestick chart)", it is sufficient to create MQL5 indicators according to the number of necessary windows, and copy the necessary indicator buffers from the main code to each of these indicators.

 
Yedelkin:

If "one code calculates several charts (indicators)", then, most likely, indicator buffers for each of these indicators are calculated in one code. To output the values of indicator buffers in "several different windows (in separate windows below the candlestick chart)", it is sufficient to create MQL5 indicators according to the number of necessary windows, and copy the necessary indicator buffers from the main code into each of these indicators.

Dear Yedelkin, thank you for your reply. It is true, I have a few indicator buffers in my code (I have turned them on or off, to draw one or another chart separately). Could you please tell me how to copy an existing indicator buffer, which is in the main code, to another indicator?
 

-Alexey-:
 подскажите пожалуйста, как копировать имеющийся индикаторный буфер, который находится в основном коде, в другой индикатор?

So I've inserted a link to"copy in each of these indicators" in the reply. Here is the link to the documentation itself:https://www.mql5.com/ru/docs/series/copybuffer If anything is unclear on this link, ask.
Документация по MQL5: Доступ к таймсериям и индикаторам / CopyBuffer
Документация по MQL5: Доступ к таймсериям и индикаторам / CopyBuffer
  • www.mql5.com
Доступ к таймсериям и индикаторам / CopyBuffer - Документация по MQL5
 
Yedelkin:
So I've inserted a link to"copy in each of these indicators" in the reply. Here is the link to the documentation itself:https://www.mql5.com/ru/docs/series/copybuffer If anything is unclear on this link, please ask.
Thank you. I will try to figure it out.
 
-Alexey-:
Thank you. I'll try to figure it out.
There's nothing complicated there. Each of your indicator buffers is pre-numbered in the source code. You create a new indicator and indicator buffers for it, and then you request the indicator buffer from the source code using the CopyBuffer function and you copy the required values from it to the indicator buffer of the new indicator.
 
Yedelkin:
There's nothing complicated there. Each of your indicator buffers is pre-numbered in the source code. You create a new indicator and indicator buffers for it, and then you request the indicator buffer from the source code using the CopyBuffer function and copy the necessary values from it.
Everything seems to be clear. At first, you should use the ICustom function, because its result Handle is required by the CopyBuffer function, then you should use the CopyBuffer function with the previously obtained parameter Handle. Did I understand correctly, the code for the calculation of the buffers should not be placed in the chart, but only the indicators that copy the buffers from the chart and display them?
 

-Alexey-:
Кажется, все понятно. Вначале необходимо использовать функцию ICustom, т.к. ее результат Handle нужен функции CopyBuffer, потом использовать функцию CopyBuffer с полученным ранее параметром Handle.

Quite right. I didn't mention the iCustom.

-Alexey-:
Did I get it right that the code with buffer calculations may not be placed on the chart, but only indicators that copy buffers from it and display them?
At least, I do it this way and it works. ...Try to apply this scheme to at least one indicator buffer from the source code to a subwindow and everything will work as if "by magic".