Hello ,
I would like to add a text pool on one corner of the chart.
So if I drag the text to one place , its stays in the new place and new one is created in the same corner instead of the one I just took.
I made an indicator , but it doesn't work as I want , any help is highly appreciated.
I would like to add a text pool on one corner of the chart.
So if I drag the text to one place , its stays in the new place and new one is created in the same corner instead of the one I just took.
I made an indicator , but it doesn't work as I want , any help is highly appreciated.
PHP Code
//+------------------------------------------------------------------+ //| DNumbers.mq4 | //| Copyright © 2012, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2012, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_chart_window #property show_inputs extern int Corner = 3; // from 0 to 3 extern int Yshift =60; extern int Xshift = 60; //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { //---- string one= "1"; if(ObjectFind(one) == -1 ) { ObjectCreate(one, OBJ_LABEL, 0, 0, 0); ObjectSetText(one,"1", 12, "Arial", White); ObjectSet(one, OBJPROP_CORNER, Corner); ObjectSet(one, OBJPROP_XDISTANCE, 40+Xshift); ObjectSet(one, OBJPROP_YDISTANCE, 60+Yshift); } if(ObjectFind(one) != -1 && (ObjectGet(one,OBJPROP_XDISTANCE)!=40+Xshift || ObjectGet(one,OBJPROP_YDISTANCE)!=60+Yshift)) { ObjectCreate(one+DoubleToStr(Seconds(),0), OBJ_LABEL, 0, 0, 0); ObjectSetText(one+DoubleToStr(Seconds(),0),"1", 12, "Arial", White); ObjectSet(one+DoubleToStr(Seconds(),0), OBJPROP_XDISTANCE, ObjectGet(one,OBJPROP_XDISTANCE)); ObjectSet(one+DoubleToStr(Seconds(),0), OBJPROP_YDISTANCE, ObjectGet(one,OBJPROP_YDISTANCE)); } //---- return(0); } //+------------------------------------------------------------------+
Attached File(s)