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

William Roeder  
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++)
          for(counter=i ;counter<=i+9;counter++)
someone please..?
still cant get it to work properly please can someone post the right code..?, thank you