Questions from Beginners MQL4 MT4 MetaTrader 4 - page 217
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Mmm, maybe.
You're the first one who hasn't had it yet))
But it does not matter, can pop up in anyone - so you have to fix it, unfortunately.
I have a lot of them, it depends on the version of MT4 (I have one from Alpari).
I have a lot of them from different versions, I'm programming for them :-) but the software is still the same, they only differ in small branding and small chips in indicators/advisors.
PS/ colour tricks can be caused by wrong DPI setting of the monitor, presence of "colour temperature correcting utilities", "video card game extensions". And so on and so forth.
PPS/by the way no DC has overcome (more likely due to greed, money) own indicators/advisors/scripts/tools package. At most a cheesy dashboard in corporate colours. Which sort of hints at
Hello!
Can you tell me why OBJPROP_XSIZE gives 0?
Hello!
Can you tell me why OBJPROP_XSIZE gives 0?
OBJ_LABEL is a very specific object - after placement and before the first chart update, the width (X_SIZE) is not defined.
It depends on font, dpi of the screen. Until rendering fully works, we can't say anything about real width.
OBJ_LABEL is a very specific object - after placement and before the first chart update, the width (X_SIZE) is undefined.
It depends on the font, dpi of the screen in general. Until rendering fully works, we can't say anything about real width.
Try to redraw it and then check
Try redrawing and then check afterwards
Thank you, I will give it a try!
It didn't work.OBJ_LABEL is a very specific object - after placement and before the first chart update, the width (X_SIZE) is undefined.
It depends on the font, dpi of the screen in general. Until rendering functions work completely, I can't say anything about real width.
Thanks, the idea is clear, I'll experiment with something.
Thanks, I get the idea, I'll experiment with it.
ChartRedraw does not redraw directly, it just puts a tick somewhere in the depths of the terminal "the chart should be redrawn as soon as possible".
To find out which width the text mark (should) get, you can try TextSetFont, TextGetSize - significant difference can only appear at HiDPI. Or maybe not :-) I haven't tried it
or get the width of real OBJ_LABEL already at the next tick/chart_event, i.e. exactly after repaint
ChartRedraw does not redraw directly, it just puts a tick somewhere in the depths of the terminal "the chart should be redrawn as soon as possible".
To find out which width a text mark (should) get, you can try TextSetFont, TextGetSize - significant difference can only appear at HiDPI. Or maybe not :-) I haven't tried it
or get the width of real OBJ_LABEL already at the next tick/chart_event, i.e. exactly after redrawing
Already got it working, thanks! Added OnDeinit(), put a delay there, and then OBJPROP_XSIZE.
P.S. I couldn't think of anything better to do with the delay in the script:
for(int i=100000000; i>0; i--) {}
Thanks, it all worked out! I added OnDeinit(), put a delay there, and then OBJPROP_XSIZE.
P.S. I couldn't think of anything better to do with the delay in the script:
// задержка 500 милисекунд, годная для тестера
ulong timestamp=GetTickCount64();
do {
Sleep(500/4); // в тестере не сработает, зато спасёт GetTickCount
} while(GetTickCount64()-timestamp<500);
// задержка 500 милисекунд, годная для тестера
ulong timestamp=GetTickCount64();
do {
Sleep(500/4); // в тестере не сработает, зато спасёт GetTickCount
} while(GetTickCount64()-timestamp<500);
Thank you, it worked!