//+------------------------------------------------------------------+
//|                                                      Blue_Spread |
//|                                      Copyright 2015, SelfTraders |
//|                                               http://www.stfx.tk |
//+------------------------------------------------------------------+
#property copyright "SelfTraders"
#property link      "http://www.stfx.tk"
#property indicator_chart_window

extern int   Distance  = 0;
extern int   Size      = 5;
extern bool  Hcol1     = true;
extern color hcol1     = clrDarkTurquoise; //Color1
extern bool  Hcol2     = true;
extern color hcol2     = clrIndigo; //Color2
extern bool  HcolSpred = true;
extern color hcolSpred = clrGray; //Color3
extern int   DistanceSpreda  = 0;

int init  (){return(0);}
int deinit(){Comment("");ObjectDelete("RT1");ObjectDelete("RT2");ObjectDelete("RT3");return(0);}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start ()
  {
   Comment("");ObjectDelete("RT1");ObjectDelete("RT2");ObjectDelete("RT3");
   double MBID=MarketInfo(Symbol(),MODE_BID   );
   double MASK=MarketInfo(Symbol(),MODE_ASK   );
   double MSPR=MarketInfo(Symbol(),MODE_SPREAD);
   double timeX;
   if(Period()==1   )timeX=60;if(Period()==5    )timeX=300;if(Period()==15   )timeX=900;
   if(Period()==30  )timeX=1800;if(Period()==60   )timeX=3600;if(Period()==240  )timeX=14400;
   if(Period()==1440)timeX=86400;if(Period()==10080)timeX=604800;if(Period()==43200)timeX=2592000;
   if(Hcol1)
   ObjectCreate("RT1",OBJ_RECTANGLE,0,Time[3000]+timeX/2,MBID,TimeCurrent()+timeX*Distance,MASK);
   ObjectSet("RT1",OBJPROP_COLOR,hcol1);
   if(Hcol2)
   ObjectCreate("RT2",OBJ_RECTANGLE,0,TimeCurrent()+timeX*Distance,MBID,TimeCurrent()+timeX*1000,MASK);
   ObjectSet("RT2",OBJPROP_COLOR,hcol2);
   ObjectCreate("RT3",OBJ_TEXT,0,TimeCurrent()+timeX*DistanceSpreda,(4*MASK+MBID)/5);
   ObjectSetText("RT3",DoubleToStr(MSPR/10,1),Size,"Lucida console",hcolSpred);
   return(0);
  }
//+------------------------------------------------------------------+
