Changing Indicator font size

Post Reply
Gandalf6
Trader
Posts: 14
Joined: Sat Dec 20, 2014 9:19 pm
Location: Middle Earth

Changing Indicator font size

Post by Gandalf6 »

Hi all,

Can anyone direct me as to how to add a font size variable to text-based indicators. What code do I need, and where do I need to place it. I am new to MQL, but feel competent enough to learn, and this would be a very helpful start.

Because I use a large monitor with windows font size set to 150%, any text-based indicator shows as squashed up and overlapping. This was resolved in an earlier posting by the legend Tommaso, and an example can be seen here:
http://www.stevehopwoodforex.com/phpBB3 ... 5&start=90

Any help/guidance would be greatly appreciated.
dudest
Trader
Posts: 1847
Joined: Tue May 08, 2012 2:37 pm

Changing Indicator font size

Post by dudest »

Hallo Mithrandir!

Maybe this can help; I modified an existing indi for my own use some time ago

Cheers
20150105_xagusd_h4_pipvalue_example.png
You do not have the required permissions to view the files attached to this post.
Gandalf6
Trader
Posts: 14
Joined: Sat Dec 20, 2014 9:19 pm
Location: Middle Earth

Changing Indicator font size

Post by Gandalf6 »

Thanks dudest,

What is the actual code that you put into the indi? (Font size code)

I specifically want to change some of the text indi's provided by balluda. Some of his indi's are text only, and I am having the same problem as with the example I previously mentioned.

Regards from Middle Earth,

Gandalf
dudest
Trader
Posts: 1847
Joined: Tue May 08, 2012 2:37 pm

Changing Indicator font size

Post by dudest »

Line #5 --> allow for the user to change the font size

Code: Select all

extern int font_size = 35; 
==

Lines #31 to #39 --> creation of the label object to hold the font, and setting of its parameters

Code: Select all

string obj_name="label_object";
long current_chart_id = ChartID();
ObjectCreate(current_chart_id,obj_name,OBJ_LABEL,0,0,0);
ObjectSetInteger(current_chart_id,obj_name,OBJPROP_COLOR,clrBlue);
ObjectSetString(current_chart_id,obj_name,OBJPROP_TEXT,info);
ObjectSetInteger(current_chart_id,obj_name,OBJPROP_CORNER,CORNER_RIGHT_UPPER);
ObjectSetInteger(current_chart_id,obj_name,OBJPROP_FONTSIZE,font_size);
ObjectSet(obj_name,OBJPROP_YDISTANCE,y);
ObjectSet(obj_name,OBJPROP_XDISTANCE,x);
=> ObjectSetInteger(current_chart_id,obj_name,OBJPROP_FONTSIZE,font_size);
==

If above still doesn't do it for you, you can PM Paul, he surely respond with help

PS: do NOT pass by Isengard for help, it's a trap!

:)
Gandalf6
Trader
Posts: 14
Joined: Sat Dec 20, 2014 9:19 pm
Location: Middle Earth

Changing Indicator font size

Post by Gandalf6 »

Thanks dudest,

I will start playing around with the code. I am a new to MQL, but I am sure I will learn the language, and starting with this will help. Thanks once again. :good:

Out of curiosity, how is isengard a trap?

Regards. :clap:
dudest
Trader
Posts: 1847
Joined: Tue May 08, 2012 2:37 pm

Changing Indicator font size

Post by dudest »

Gandalf6 » Mon Jan 05, 2015 11:24 am wrote:
...

Out of curiosity, how is isengard a trap?

Regards. :clap:
...You know, the way that other guy in white had been communicating with the single-eye guy via a seeing stone...

:)
Post Reply

Return to “Coders Hangout”