title: What is the difference between init() and OnInit()?
body: <p>I am learning MQL4. On their reference website, creating a custom indicator is done like as follows:</p>
  
  <pre><code>#property indicator_chart_window
  
  int init(){
      return(0);
  }
  
  int deinit(){
      ObjectsDeleteAll();
      return(0);
  }
  
  int start(){
  
      return(0); 
  }
  </code></pre>
  
  <p>But when I create a new Indicator from inside the MetaEditor, I get another syntax, like this:</p>
  
  <pre><code>int OnInit()
   { 
   //--- indicator buffers mapping
  
   //---
   return(INIT_SUCCEEDED);
  }
  //+------------------------------------------------------------------+
  //| Custom indicator iteration function                              |
  //+------------------------------------------------------------------+
  int OnCalculate(const int rates_total,
              const int prev_calculated,
              const datetime &amp;time[],
              const double &amp;open[],
              const double &amp;high[],
              const double &amp;low[],
              const double &amp;close[],
              const long &amp;tick_volume[],
              const long &amp;volume[],
              const int &amp;spread[])
   { 
  //---
  
  //--- return value of prev_calculated for next call
  return(rates_total);
  }
  </code></pre>
  
  <p>Why is it different?</p>
  
  <p>Is there a web link, or book someone can refer me to?
  From what I read the best place is the MQL4 website, but it looks different and I am not sure where to turn to now.</p>
  
  <p>Any help will be appreciated. Thanks in advance.</p>