//--- #property indicator_separate_window #property indicator_buffers 1 #property indicator_plots 1 #property indicator_type1 DRAW_LINE double Buffer[]; int handle; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnInit() { SetIndexBuffer(0,Buffer); Print("Call user_indicator PERIOD_H12"); handle=iCustom( Symbol(), PERIOD_H12, "user_indicator", 14 ); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const int begin, const double &price[]) { if(BarsCalculated(handle)<=0) return(prev_calculated); //--- variables Print("End..."); //---- OnCalculate done. Return new prev_calculated. return(rates_total); } //+------------------------------------------------------------------+