Average daily range indicator, help !!

 

Hello everyone,

Im trying to code my first MT4 indicator. It's a simple indicator to show on the upper left corner of the chart the average daily range (high - low, in pips) for a currency during the last 100 periods. But no matter how hard I try, it just doesnt do anything at all and I cannot spot out where the problem is.

Can anyone please have a quick look and tell me where the bug is? I attach the indicator down below.

By the way, is there any chance I could also set another parameter to analyze the average range during the last 100 days but only from 7 AM to noon? that's the time frame I usually trade so that piece of info would be useful for me too.

Thank you very much in advance

Files:
 
 

Thanks for the feedback LinuxUser, but I have followed your advices and still it wouldnt work

Any idea what am I doing wrong?

 
Pepinillo:
Hello everyone,

Im trying to code my first MT4 indicator. It's a simple indicator to show on the upper left corner of the chart the average daily range (high - low, in pips) for a currency during the last 100 periods. But no matter how hard I try, it just doesnt do anything at all and I cannot spot out where the problem is.

Can anyone please have a quick look and tell me where the bug is? I attach the indicator down below.

By the way, is there any chance I could also set another parameter to analyze the average range during the last 100 days but only from 7 AM to noon? that's the time frame I usually trade so that piece of info would be useful for me too.

Thank you very much in advance

Everything you need should be in this indicator

lnx_pivots_v2.mq4

Files:
Reason: