Navigation´╝ÜHome > Content >

PriceLevelLine.mq4

Time: 2018-05-28 | Download file:PriceLevelLine.mq4

//+------------------------------------------------------------------+
//|                                               PriceLevelLine.mq4 |
//+------------------------------------------------------------------+
#property copyright "Made by CJA for tsd"

#property indicator_chart_window

extern double PriceLevel = 1.6445;

extern color  LineColor  = Gold;
extern int    LineStyle  = 0;
extern int    LineWidth  = 0;
extern string LineLabel  = "";
extern color  LabelColor = Silver;
extern string LabelFont  = "Arial";
extern int    LabelSize  = 10;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators

 
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
  ObjectDelete("Priceline "+DoubleToStr(PriceLevel,Digits)); 
  ObjectDelete("Priceline2 "+DoubleToStr(PriceLevel,Digits));
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
   {
  ObjectDelete("Priceline2 "+DoubleToStr(PriceLevel,Digits));
    
  ObjectCreate("Priceline "+DoubleToStr(PriceLevel,Digits), OBJ_HLINE, 0,Time[0],PriceLevel );
  ObjectSet("Priceline "+DoubleToStr(PriceLevel,Digits), OBJPROP_COLOR, LineColor);
  ObjectSet("Priceline "+DoubleToStr(PriceLevel,Digits), OBJPROP_WIDTH, LineWidth);
  ObjectSet("Priceline "+DoubleToStr(PriceLevel,Digits), OBJPROP_STYLE, LineStyle);
  ObjectSet("Priceline "+DoubleToStr(PriceLevel,Digits),OBJPROP_BACK,false);
  ObjectCreate("Priceline2 "+DoubleToStr(PriceLevel,Digits), OBJ_TEXT, 0,Time[0] ,PriceLevel );
  ObjectSetText("Priceline2 "+DoubleToStr(PriceLevel,Digits),"                             "+LineLabel+"", LabelSize,LabelFont, LabelColor);
   
 



   return(0);
  }
  

//+------------------------------------------------------------------+

Recommend