ExtUpperBuffer being set to 0.0 on new bar. In the If Else it is hard coded for troubleshooting purposes

 

 Im trying to identify fractals on an indicator such as OBV. In this example for troubleshooting ive hard coded the value in the OnCalc for this buffer to either be 420000 or 220000 just to simplify the troubleshooting and visibility, and in OnInit the value is EMPTY_VALUE

When I load the indicator the values are as would be expected/normal but when a new candle comes in the data window and print are showing 0.00 and 0.0 respectively. Trying to understand the HOW/WHY here and appreciate the insight. 

Files:
 

Here is a screen shot. To the left of 3 May 23:10 is normal/expected and as new bars fire the value of 0.0/0.00 is being set. 

Files:
 

I created the 'Fractals On OBV' indicator - is that what you wanted?


Files:
 
Vladimir Karputov #:

I created the 'Fractals On OBV' indicator - is that what you wanted?


Awesome. Ill compare yours vs mine to see if I can understand what I was doing wrong and causing the print of 0.0 on a new bar instead of EMPTY_VALUE for the fractal buffers. Thank you for your help and time to build up others. Much appreciated. 

 
and your notes/comments are extremely helpful. +1
Reason: