#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)); } return(0); } int start() { double price1; int j,count,k=0; int objtot=ObjectsTotal(); string nameH[],null_string; ArrayResize(nameH,objtot); //----------------- 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("Need to add some horizonal lines !!! "); return(0); } ArrayResize(nameH,k); 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],"Distance: "+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: