Problem with a custom indicator (won't refresh it self automaticly...)

 
Karish: won't refresh it self automaticly...
  1.       ma_future= iMA(NULL, 0,MA, -1, 2, PRICE_CLOSE,i);
    You can't look at the future when i == 0.
  2. Basing an indicator that looks at future bars is called repainting. Useless for trading.
  3. You look back 9 bars, so do your look back correctly
    // if(counted_bars>0) counted_bars--; unnecessary Contradictory information on IndicatorCounted() - MQL4 forum
    //----
    // limit=bars-counted_bars;               no look back
       limit=bars-MathMax(9,counted_bars); // look back = 9
    //   for(i=0; i<=limit; i++)              when counted=0 you access High[Bars]
    //                                        array exceeded, indicator dies.
         for(i=1; i< limit; i++)
         {
          counter=i;
          Range=0;
          AvgRange=0;
          for(counter=i ;counter<=i+9;counter++)
            {
             AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
 

WHRoeder,

thank you for your replay, i still can't solve this problem though.., can you maybe upload the complete fixed code for me please if you can

i did tried to change those things you highlighted but now it won't show any arrows until i switch TFs...

 

thank you again, hope to hear from you soon.

 
someone please..?
 
still cant get it to work properly please can someone post the right code..?, thank you
Reason: