Emma Schwatson: Use SetIndexEmptyValue to something like EMPTY_VALUE. Then if you don't want to plot the buffer just set all the elements to EMPTY_VALUE. Example indicator.
Hi there, I am trying to make my panel buttons in a subwindow. So far so good...but When i want to show the moving average, it displays in the subwindow, instead of main chart.
I really try to find a solution...But with no success. Can someone show the way to do it please ?
Thierry Ramaniraka: Immediatly hide/show Moving Averages after click on button. But, now, it always waits a tick, as the function is placed in "OnCalculate".
It updates in OnCalculate because that is where the terminal expects buffers and objects to be changed and it calls redraw for you on return.
It doesn't work, because if my chart is totally naked, when I drag/drop my indicator, we will not see the button because it will draw in the subwindow1 with is'nt even exist.
Since it is necessary to prepare the buffer on the main chart, "#property indicator_chart_window" is required. A button object can be created in any window, but you can not do it in a window which does not exist.
Thank you, higher than my actual knowledge with class and include.
But i kep it.
Regards.
By now you should know how to use the debugger to step through code you don't well understand in order to see how it works.
By now you should know how to use the debugger to step through code you don't well understand in order to see how it works.
Ok I didn't know.
I will give it a try.
Use SetIndexEmptyValue to something like EMPTY_VALUE. Then if you don't want to plot the buffer just set all the elements to EMPTY_VALUE. Example indicator.
Hi there,

I am trying to make my panel buttons in a subwindow. So far so good...but
When i want to show the moving average, it displays in the subwindow, instead of main chart.
I really try to find a solution...But with no success.
Can someone show the way to do it please ?
I just change the button's subwindow parameter to "1".
here is the code provided by Emma Schwatson
I just change the button's subwindow parameter to "1".
But, now, it always waits a tick, as the function is placed in "OnCalculate".
It updates in OnCalculate because that is where the terminal expects buffers and objects to be changed and it calls redraw for you on return.
OnTimer and OnChartEvent do not call ChartRedraw (or WindowRedraw.)
It doesn't work, because if my chart is totally naked, when I drag/drop my indicator, we will not see the button because it will draw in the subwindow1 with is'nt even exist.
I really need to keep
and "force" draw the MAs int he main chart...
Any suggestion ?
It updates in OnCalculate because that is where the terminal expects buffers and objects to be changed and it calls redraw for you on return.
OnTimer and OnChartEvent do not call ChartRedraw (or WindowRedraw.)
I used DRAW NONE to solve it.
A button object can be created in any window, but you can not do it in a window which does not exist.