horiz_dist





#property copyright "neo"
#property link      "http://www.metaquotes.net"

#property indicator_chart_window


int init()
  {
	  return(0);
  }

int deinit()
  {  
	  int j,count;
    int objtot=ObjectsTotal();
	  for (j=objtot-1; j>=0; j--) 
		 {
		   if(StringSubstr(ObjectName(j),0,4)=="illu" && ObjectType(ObjectName(j))==OBJ_TEXT) ObjectDelete(ObjectName(j));
		   //count--;
		 }  
	  return(0);
  }

int start()
  {
	  double price1;
	  int j,count,k=0;
    int objtot=ObjectsTotal();
	  string nameH[],null_string;
	  
	  //----------------- filter out all horizontal lines
	    for (j=0; j<objtot; j++) 
		   {
			 if(StringSubstr(ObjectName(j),0,9)=="Horizonta" && ObjectType(ObjectName(j))==OBJ_HLINE) 
			   { 
					nameH[k]=ObjectName(j);
				    k ++;
			   }
		   }
		 
		if(k<1) 
			{
				Comment("ÇëÌí¼ÓˮƽÏß !!! ");
				return(0);
			}
	
		ArrayResize(nameH,k); 
//	Print("name0: "+nameH[0]+".....name1: "+nameH[1]);
		
		for(j=0; j<k; j++)
			{
				price1=ObjectGet(nameH[j],OBJPROP_PRICE1); 
				ObjectCreate("illu"+nameH[j], OBJ_TEXT, 0,Time[WindowFirstVisibleBar()-15],price1+8*Point  );
				ObjectSetText("illu"+nameH[j],"¾àÀë: "+DoubleToStr(MathAbs(price1-Close[0])/Point,0),14,"Times New Roman",Orange);

			}		          
					
	  return(0);
  }





Sample





Analysis



Market Information Used:

Series array that contains open time of each bar
Series array that contains close prices for each bar


Indicator Curves created:


Indicators Used:



Custom Indicators Used:

Order Management characteristics:

Other Features: