Function PlotIndexSetDouble()

 

Hello,

I'm looking for optimizations in the indicators and would like a suggestion. To prevent the indicator from representing empty_values, I am considering the function:


PlotIndexSetDouble(index buffer, PLOT_EMPTY_VALUE, 0.0);


My question is whether the best place to include this code is OnInit() or OnCalculate().


can anybody help me?


Thanks.

Documentação sobre MQL5: Indicadores Customizados / PlotIndexSetDouble
Documentação sobre MQL5: Indicadores Customizados / PlotIndexSetDouble
  • www.mql5.com
PlotIndexSetDouble - Indicadores Customizados - Referência MQL5 - Referência sobre algorítimo/automatização de negociação na linguagem para MetaTrader 5
 
Ronaldo Franco De Oliveira Cardoso:

Hello,

I'm looking for optimizations in the indicators and would like a suggestion. To prevent the indicator from representing empty_values, I am considering the function:


PlotIndexSetDouble(index buffer, PLOT_EMPTY_VALUE, 0.0);


My question is whether the best place to include this code is OnInit() or OnCalculate().


can anybody help me?


Thanks.

In OnInit() unless it's changing dynamically, which is certainly not a good idea unless you know what your are doing.

Also the first parameter is a plot index and not a buffer index. Could be different.

 
Alain Verleyen #:

In OnInit() unless it's changing dynamically, which is certainly not a good idea unless you know what your are doing.

Also the first parameter is a plot index and not a buffer index. Could be different.

Thanks for your comment. Helped me.