Features of the mql4 language, subtleties and techniques - page 16

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I hope you're friends)
"War of the Titans" is not going to happen.
Is there any way to know directly from program what font is currently in windows (enlarged or not) and make this correction in code, without touching the users? Just some people may have 4k monitor with scaled text and most of indicators (where text is used) from market looks ugly and ugly.
I hope the thread isn't dead. I have the following problem: I have a 4k monitor, hence in Windows I have an enlarged font (size 200%). When you make text objects for indicators, the text size is taken from Windows settings and is also scaled, as a result, if you make something that looks normal on a normal system, on my computer the text overlaps each other, and if you make it normal for me, then on normal settings the text is too small. I have made a setting in the indicator to let the user choose whether it is scaled or not, but I don't really like it.
Is there any way to know directly from program what font is currently in windows (enlarged or not) and make this correction in code, without touching the users? Some people may have 4k monitor with scaled text and most of indicators (where text is used) from market looks ugly.
Maybe you should switch to working with resources, or CCanvas?
Then you can set the font size there according to the settings of the operating system.
Read about TextOut(), TextSetFont()
That's it, the solution is found. For those wondering what it is: Use the TerminalInfoInteger(TERMINAL_SCREEN_DPI) function; With standard scaling it will be 96. If 2 times bigger, then the scaling will be 2 times accordingly.
The solution is in the help
Example of calculating the scaling factor:
The solution is in the help
Yeah, but it's not for fonts.
That's it, the solution is found.
really? does scaling affect monitor dpi?
Forum on trading, automated trading systems and trading strategies testing
Peculiarities of mql5 language, tips and tricks
fxsaber, 2019.02.19 22:28
You see the position opened and closed at the same price. But their prices are not equal when compared without normalisation!