discontinuous buffer in custom indicator

 

Hello everyone,


As we know that buffer value is calculated from price series such as moving average,rsi. which these indicators have continuous value.


What if the calculated value is not continuous like following image (blue line). What data type should the buffer store in the gap range?



Thank you very much

 
EMPTY_VALUE
          HOW CAN I hide CONNECTION lines of plots? (ttt) - MQL4 programming forum (2016)

For MT4 I use:

  1. One buffer has the value, color set to CLR_NONE so not shown on chart, (but in data window and pop up.)
  2. Two buffers, one color each, with SetIndexLabel(i, NULL) so they don't show in data window.
  3. Then you need to connect the lines on color change. downBuffer[i]=value[i]; if(downBuffer[i+1]==EMPTY_VALUE) downBuffer[i+1]=value[i].
 
Kittamet Sirinyamas: What if the calculated value is not continuous like following image (blue line). What data type should the buffer store in the gap range?

Fill the gap with the value of the constant "EMPTY_VALUE"!

EMPTY_VALUE

Empty value in an indicator buffer

DBL_MAX

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Other Constants
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Other Constants
  • www.mql5.com
Other Constants - Named Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Thank you for help.
Reason: