Compressed Text on Indicator in Win 10 Laptop

To add comments, please log in or register
Rockster
20
Rockster  

HELP!!!

I bought a new laptop with Windows 10. MT4 and my custom indicator operate properly. However, the chart text is compressed and overlaps. See image.

Text Overlapping

The laptop display settings shows 250% (Recommended). If I change to 100%, the text still overlaps a bit but cannot be read because it is so small and all other parts of MT4 at too small as well.

I tried running MT4 in Windows 7 mode, in 640 x 480, disabling display scaling on high DPI settings and changing the font size. Nothing fixes this problem.

This indicator works perfect on a desktop machine with Windows 7.

Is there code that can be added to the indicator or other settings in Windows 10 that might help fix this problem.

Thanks for your replies.

Files:
honest_knave
Moderator
2302
honest_knave  

All your indicators need to be re-coded to take into account the large Windows display setting... a lot of indicators were coded before many people had ultra-high resolution screens so it wasn't an issue.

Rockster
20
Rockster  
honest_knave:

All your indicators need to be re-coded to take into account the large Windows display setting... a lot of indicators were coded before many people had ultra-high resolution screens so it wasn't an issue.

Thanks, knave, for your reply.

Can you direct me to a page that has examples of code that I need to use that takes into account large Windows display settings? I am not sure where to start. Thanks.

honest_knave
Moderator
2302
honest_knave  
Rockster:

Thanks, knave, for your reply.

Can you direct me to a page that has examples of code that I need to use that takes into account large Windows display settings? I am not sure where to start. Thanks.

It will be quite a task, particularly if the indicators are coded by other people; you'll need to unravel someone else's code before you can make the changes.

If you are going to do it, you have a few options.

You could add a setting to your indicators e.g. Text Scale with a value 1-5. The user sets it to their preference, and the code uses it to change the font size when drawing objects.

Or, you could try making it automatic based on the DPI. A "normal" monitor will be 96dpi. You can check yours with a simple script (I'm guessing somewhere in the range 130-200):

#property strict

void OnStart()
  {
   Alert(TerminalInfoInteger(TERMINAL_SCREEN_DPI));
  };

The problem with this approach is that some people do not use the Windows "recommended" scaling %.... which brings you back around to a user setting in each indicator.

You could try a standalone script that loops through all the objects on the chart and drops the font size. But again, you are at the mercy of the original code and how often it redraws the objects. Some even redraw every tick...

Here is an easy fudge that may (or may not) work: it attempts to drop the font size to 75% on every object on the chart. You could refine it by only looking for certain object types, putting it in an indicator to run whenever timeframes change etc.

#property strict

void OnStart()
  {
   for(int i=0; i<ObjectsTotal(); i++)
     {
      string name =ObjectName(i);
      long fontsize=ObjectGetInteger(0,name,OBJPROP_FONTSIZE);
      ObjectSetInteger(0,name,OBJPROP_FONTSIZE,long(fontsize*0.75));
     }
  };
To add comments, please log in or register