//+------------------------------------------------------------------+
//|                                                  n Bars Back.mq4 |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property strict

extern int              n_bars_period     = 12;                //TMA Channel HalfLength Period
extern color            LineColor         = clrCrimson;        //Line Color
extern ENUM_LINE_STYLE  LineStyle         = STYLE_DASHDOTDOT;  //Line Style
extern int              LineWidth         = 1;                 //LIne Width
extern bool             Draw_as_Background= true;              //Draw line in Background?

int init(){return(0);}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
  {
   ObjectDelete("n_bars");
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   ObjectDelete("n_bars");
   ObjectCreate("n_bars",OBJ_VLINE,0,Time[n_bars_period],Bid);
   ObjectSet("n_bars",OBJPROP_COLOR,LineColor);
   ObjectSet("n_bars",OBJPROP_STYLE,LineStyle);
   ObjectSet("n_bars",OBJPROP_WIDTH,LineWidth);
   ObjectSet("n_bars",OBJPROP_BACK,Draw_as_Background);

   return(0);
  }
//+------------------------------------------------------------------+
