Download MetaTrader 5
To add comments, please log in or register
Make profit on MQL5 services. It's easy!
BurkhardWille
143
BurkhardWille 2014.05.22 10:11 

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);
}
Bambang Sugianto
9831
Bambang Sugianto 2014.05.25 11:11  

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 

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.05.25 11:40  
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.
ffoorr
985
ffoorr 2014.05.25 13:56  

Try that maybe ? :  OBJPROP_ANCHOR

BurkhardWille
143
BurkhardWille 2014.05.27 11:04  
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.

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.05.27 12:25  
Thats don't work so good with diffrent fontsizes.


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

BurkhardWille
143
BurkhardWille 2014.05.28 08:59  

Hey deysmacro,

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

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.05.28 10:12  
I heard that the new beta build, bug fixed already.
BurkhardWille
143
BurkhardWille 2014.05.28 10:44  
Build later than 646? When comes out the official version?
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.05.28 11:20  

Yes. We have a beta build > 646.


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

Alain Verleyen
Moderator
28627
Alain Verleyen 2014.05.28 19:06  
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
/
To add comments, please log in or register