Continuous R/S zones using buffers

 

Hello everyone.

When painting horizontal R/S indicator buffers I have to leave an index blank. Else it will draw a funny sloped line to connect the two points.

Is there a logical solution?


 

The first option that comes to mind, is to use two alternating buffers for the same level as it changes price.

Another option is using DRAW_ZIGZAG which also uses two buffers, but allows you to connect them with a vertical line instead of a slopped one.

 
  1. On MT5 you can place end points between bars if you Check Tools → Options (control+O) → Charts → precise time scale
              Is it possible not to snap to the grids? - MQL5 programming forum #5 (2018)

  2. For MT4, see
              HOW CAN I hide CONNECTION lines of plots? (ttt) - MQL4 programming forum (2016)

  3. 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].
 
Fernando Carreiro #:

The first option that comes to mind, is to use two alternating buffers for the same level as it changes price.

Another option is using DRAW_ZIGZAG which also uses two buffers, but allows you to connect them with a vertical line instead of a slopped one.

I really liked the ZigZag idea. Thanks.

 
William Roeder #:
  1. On MT5 you can place end points between bars if you Check Tools → Options (control+O) → Charts → precise time scale
              Is it possible not to snap to the grids? - MQL5 programming forum #5 (2018)

  2. For MT4, see
              HOW CAN I hide CONNECTION lines of plots? (ttt) - MQL4 programming forum (2016)

  3. 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].

Thanks for solutions.