//+------------------------------------------------------------------+
//| TRO_LINE_PLOT |
//| |
//| |
//| Copyright � 2008, Avery T. Horton, Jr. aka TheRumpledOne |
//| |
//| PO BOX 43575, TUCSON, AZ 85733 |
//| |
//| GIFTS AND DONATIONS ACCEPTED |
//| |
//| therumpledone@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright � 2008, Avery T. Horton, Jr. aka TRO"
#property link "http://www.therumpledone.com/"
#property indicator_chart_window
//---- input parameters
extern double myPrice = 100;
extern color myColor = Magenta ;
extern int myLineStyle = 2 ;
extern int myLineTickness = 1 ;
string line1 = "LPline1" ;
//+------------------------------------------------------------------+
int init()
{
line1 = MakeUniqueName(line1+ Period()+Symbol(), "");
return(0);
}
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete(line1);
return(0);
}
//+------------------------------------------------------------------+
int start()
{
ObjectDelete(line1);
ObjectCreate(line1,OBJ_HLINE,0,0,0);
ObjectSet(line1,OBJPROP_COLOR,myColor);
ObjectSet(line1,OBJPROP_STYLE,myLineStyle);
ObjectMove(line1,0,Time[0],myPrice);
return(0);
}
//+------------------------------------------------------------------+
string MakeUniqueName(string first, string rest)
{
string result = first+(MathRand()%1001)+rest;
while (WindowFind(result)> 0)
result = first+(MathRand()%1001)+rest;
return(result);
}
//+------------------------------------------------------------------+