Custom indicator for ATR and Bollinger not drawing

 

Hi, I've developed the following custom indicator. The values in the data Window are shown alright, but the indicator does not draw anything.

Here's the code. Can you anyone help me please ? Thanks. 

Files:
atr_bb.mq4  4 kb
 
The lines are drawn on my platform
 
GumRai:
The lines are drawn on my platform

Thanks for the confirmation. Strange thing, could it be a version related problem ?

My MT is version 4.0 Build 840 (12 June 2015). And yours ?

 
jfortes:

Thanks for the confirmation. Strange thing, could it be a version related problem ?

My MT is version 4.0 Build 840 (12 June 2015). And yours ?

Same
 
Here's how my chart looks. Indicator window just shows a flat line in grey :(  ATR_BB_no drawn 
 
Has anyone seen this strange behaviour before ?
 

The problem is your Buffer_VB.

If you just need it to show a value in the data window or nothing, don't fix it to 1.0

This means that with 4 or 5 digit symbols the other buffers are too close together and just appear as a single straight line. 

Instead of

      if(Buffer_ATR[shift] > Buffer_BB_main[shift])
      {
         Buffer_VB[shift] = 1.0;
      
      }

 do

      if(Buffer_ATR[shift] > Buffer_BB_main[shift])
         Buffer_VB[shift] = Buffer_ATR[shift];
      else
         Buffer_VB[shift] = EMPTY_VALUE;
 
GumRai:

The problem is your Buffer_VB.

If you just need it to show a value in the data window or nothing, don't fix it to 1.0

This means that with 4 or 5 digit symbols the other buffers are too close together and just appear as a single straight line. 

Instead of

 do

 

You are totally right. It's the 1.0 value that is out of scale, making the ATR & BB look flat.

Fixed as per your suggestion and is working fine :)

 

Thanks so much for your help. 

Reason: