int i=0;
color Color_Open = clrBlue;
double price = Bid;
ENUM_LINE_STYLE Style=STYLE_SOLID;
//Horizontal Line
if(ObjectFind("Horizontal"+IntegerToString(i))>-1)
{
ObjectDelete("Horizontal"+IntegerToString(i));
if(ObjectCreate(0,"Horizontal"+IntegerToString(i), OBJ_HLINE, 0, 0, price))
{
ObjectSet("Horizontal"+IntegerToString(i), OBJPROP_COLOR, Color_Open);
ObjectSet("Horizontal"+IntegerToString(i), OBJPROP_STYLE, Style);
}
else
{
Print("Create Horizontal line failed!");
}
}
//Trend Line
double price1,price2;
price1=price2=Ask;
Color_Open = clrRed;
if(ObjectFind("TrendLine"+IntegerToString(i))>-1)
{
ObjectDelete("TrendLine"+IntegerToString(i));
if(ObjectCreate(0,"TrendLine"+IntegerToString(i), OBJ_TREND, 0, Time[0], price1,Time[5],price2))
{
ObjectSet("TrendLine"+IntegerToString(i), OBJPROP_COLOR, Color_Open);
ObjectSet("TrendLine"+IntegerToString(i), OBJPROP_STYLE, Style);
ObjectSet("TrendLine"+IntegerToString(i),OBJPROP_RAY, false);
ObjectSet("TrendLine"+IntegerToString(i),OBJPROP_WIDTH, 3);
}
else
{
Print("Create Trend line failed!");
}
}