Download MetaTrader 5

How to display info in right part of a chart?

To add comments, please log in or register
Amy Liu
645
Amy Liu  

When we use Chart Shift, there will be a space in right part of a chart. It seems that many tool display info here. Most of the functions are developed by Objects. But, to deal with objects in MQL4, there are so many functions and some of them has the same results. E.g, shiould I use OBJ_RECTANGLE_LABEL or not, should I use OBJ_TEXT or should I use ResourceCreate combined with TextOut? Can somebody give me an example for displaying information in this area that use most standerd methods? Thank you very much!

 

Alexander Voronkov
19282
Alexander Voronkov  

You can:

ObjectCreate("_LABEL_", OBJ_LABEL, 0, 0, 0);
ObjectSetInteger(0,"_LABEL_",OBJPROP_CORNER,CORNER_RIGHT_UPPER);
ObjectSetInteger(0,"_LABEL_",OBJPROP_ANCHOR,ANCHOR_RIGHT_UPPER);
ObjectSetInteger(0,"_LABEL_",OBJPROP_SELECTABLE,0);
ObjectSetInteger(0,"_LABEL_",OBJPROP_XDISTANCE,10); 
ObjectSetInteger(0,"_LABEL_",OBJPROP_YDISTANCE,30);
Amy Liu
645
Amy Liu  
Fillellin:

You can:

Thank you! But, what's the differnce between OBJ_LABEL and OBJ_TEXT? ;)
Stuart Browne
5897
Stuart Browne  
aforexpert:
Thank you! But, what's the differnce between OBJ_LABEL and OBJ_TEXT? ;)
A label object will be fixed at a certain screen coordinate. Even if you scroll the screen, it will remain at that spot. A text object will scroll with the price chart. Think of it like Label stays at an X/Y screen coordinate, text is pinned to a price coordinate (price/time). Try it yourself with the label and text objects on the menu bar.
Amy Liu
645
Amy Liu  
Filter:
A label object will be fixed at a certain screen coordinate. Even if you scroll the screen, it will remain at that spot. A text object will scroll with the price chart. Think of it like Label stays at an X/Y screen coordinate, text is pinned to a price coordinate (price/time). Try it yourself with the label and text objects on the menu bar.
Thank U very much!
Stuart Browne
5897
Stuart Browne  
aforexpert:
Thank U very much!
Very welcome :)
To add comments, please log in or register