[MT4-Bug] Problem with right aligned label created with an expert advisor and automaticly text change

 

Hi,

to show me some information of my expert advisor variables, I created some label-elements in the right top corner. Until april all gone fine, but with some new updates of Metatrader the text isn't aligned right correctly. If I change the text with an EA, the text is aligned left now. :-X

Is there a trick to solve the bug?



See a short example of my function:

double close_tmp_01;
void OnTick() {
  if (close_tmp_01 < Close[0]) {
    Create_Label("Short Text");
  } 
  else {
    Create_Label("Very looong Text");
  }

  close_tmp_01 = Close[0];
}

void Create_Label(string lbl_text = "") {
  if(ObjectFind("lbl_name") == -1) {
    ObjectCreate("lbl_name", OBJ_LABEL, 0, 0, 0);
    ObjectSet("lbl_name", OBJPROP_CORNER, 1);
    ObjectSet("lbl_name", OBJPROP_XDISTANCE, 10);
    ObjectSet("lbl_name", OBJPROP_YDISTANCE, 40);
  }

  ObjectSetText("lbl_name", lbl_text, 10, "Arial", Blue);
}
 

label

Same problem with me..  

the only thing i can do now is  objectdelete and objectcreate on every tick 

works fine in live chart.. but flickers in  visual mode backtesting 

 
Actually, the trick is to count how many characters (including spaces, negatives and digits) and then set the x coordinate accordingly. Works on-the-fly too and you gonna love it.
 

Try that maybe ? :  OBJPROP_ANCHOR

 
WDholic:

Same problem with me..  

the only thing i can do now is  objectdelete and objectcreate on every tick 

works fine in live chart.. but flickers in  visual mode backtesting 


due to performance, I should prefer another solution, because, I have a lot of label-objects (>40).


deysmacro:
Actually, the trick is to count how many characters (including spaces, negatives and digits) and then set the x coordinate accordingly. Works on-the-fly too and you gonna love it.


Thats don't work so good with diffrent fontsizes.


ffoorr:

Try that maybe ? :  OBJPROP_ANCHOR


unfortunately doesn't work with OBJPROP_ANCHOR.


The best solution is, someone have to talk with metaquotes, to fix the bug, some few weeks ago, it works still excellent.

 
Thats don't work so good with diffrent fontsizes.


Of course the font size changes on-the-fly too. Works for me.

 

Hey deysmacro,

do you know, where I can give MetaQuotes the bug-information?

 
I heard that the new beta build, bug fixed already.
 
Build later than 646? When comes out the official version?
 

Yes. We have a beta build > 646.


Official one I heard maybe June. Maybe our moderator have a more solid answers.

 
deysmacro:

Yes. We have a beta build > 646.


Official one I heard maybe June. Maybe our moderator have a more solid answers.

Sorry but I don't have more precise information. June
Reason: