anybody understands why this sjmple mql4 dosn't work ?

 
thank you
//+------------------------------------------------------------------+
//|                                                          ADX.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                       https://www.metaquotes.net// |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "https://www.metaquotes.net//"
 
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Blue
 
 
//---- input parameters
 
//---- buffers
 
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
 
 
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorShortName("Dani's DMI");
//---- indicators
 
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexLabel(0,"DI+");
 
 
 
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexLabel(1,"DI-");
 
 
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexLabel(2,"DX");
 
 
//----
   return(0);
  }
 
 
 
 
int start()
  {
 
   
   int i = Bars ;
 
 
   while(i>=0)
      {
 
         double dimain = iADX(NULL,0,14,PRICE_CLOSE,MODE_MAIN,i)  ;
         double diplus = iADX(NULL,0,14,PRICE_CLOSE,MODE_PLUSDI,i)  ;
         double diminus = iADX(NULL,0,14,PRICE_CLOSE,MODE_MINUSDI,i)  ;
      
      
 
        ExtMapBuffer1[i]= diplus ;
        ExtMapBuffer2[i]= diminus;
        ExtMapBuffer3[i]= dimain ;
     i--;
     return(0);
     }
  }
//+------------------------------------------------------------------+
 
This is indicator. What you want to do with it?
 
yada0206:
thank you
     i--;
     return(0);
     }
  }
//+------------------------------------------------------------------+

Move return(0) out of the loop:
     i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+
and start the iteration from i = Bars - 1
 
Irtron:
yada0206:
thank you
     i--;
     return(0);
     }
  }
//+------------------------------------------------------------------+

Move return(0) out of the loop:
     i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+
and start the iteration from i = Bars - 1
Thank you very much.
It works !!!
Reason: