Features of the mql5 language, subtleties and tricks - page 311
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'm sure that, for example, GetMicrosecondCount can always be used to get guaranteed different values with any reasonable number of concurrently running programmes.
Careful, microseconds start by starting the programme. Milliseconds start with the start of the computer.
You can try to catch the same values in different programmes.
You can try to catch the same values in different programmes.
Some near past the definition of anchor-points has changed.
Is anyone able to help me decypher the meaning of this documentation, please:
https://www.mql5.com/en/book/applications/objects/objects_anchor
As far as I can see, it is now much more limited (and as my personal opinion weighs here, badly limiting possibilities) it seems, it is not clearly defined how to use what type of ENUM in what situations.
There are now two types of ENUMS, the original and a new version. But the sample code isnt using them. How and in which sense are these two enums compatible to each other?
EDIT:
I personally find this to be much more confusing and limiting than required. - How do you put up a "Stop-Arrow" at the close price of a candle? - Its not possible anymore. This is usually considered to be a regression in functionality.
Also trying to calculate a proper offset to actually place the arrow at the "center" is impossible, because there is no way of determining the height. OBJPROP_WIDTH and OBJPROP_XSIZE both give NULL as result.
"A solution" is to use a textlabel and put in wingdings-font with the correct character-code to "emulate" the arrows drawn by the ObjectArrow type, this is not how this should be solved, as textlabels behave slightly different than arrows, and you cannot distinguish between an arrow and a textlabel anymore. - To accomplish this distinguation, you would need to hide some flag information within the alpha value of the color informaiton, but that is undocumented and prone to change behaviour.
EDIT2:
OBJ_TEXT supports angle to rotate the displaying of the text on chart. - But the terminal is not able to render non-TTF-fonts properly when applying an angle to the textfield. The text wil lbe displayed outside of the expected textfield.
This is not a bug as such, but a documented design change. MetaQuotes separated the concept of anchoring into two different enumerations:
That is why it now seems more "limited": arrows are not intended for pixel-perfect control, but as quick graphic markers.
Properties such as OBJPROP_XSIZE or YSIZE are not supported in these objects, so you cannot calculate an offset to centre the icon exactly on the close.
If you need precision, the practical alternative is to use OBJ_LABEL or OBJ_BITMAP_LABEL with a font (e.g. Wingdings) or a custom bitmap. There you can control the anchor and, in some cases, the size.
In summary: Yes, it is a real limitation, but it is intentional and documented by MetaQuotes. For them, arrows are decorative elements with fixed logic, not freely positionable objects.
This is not a bug as such, but a documented design change. MetaQuotes separated the concept of anchoring into two different enumerations:
That is why it now seems more "limited": arrows are not intended for pixel-perfect control, but as quick graphic markers.
Properties such as OBJPROP_XSIZE or YSIZE are not supported in these objects, so you cannot calculate an offset to centre the icon exactly on the close.
If you need precision, the practical alternative is to use OBJ_LABEL or OBJ_BITMAP_LABEL with a font (e.g. Wingdings) or a custom bitmap. There you can control the anchor and, in some cases, the size.
In summary: Yes, it is a real limitation, but it is intentional and documented by MetaQuotes. For them, arrows are decorative elements with fixed logic, not freely positionable objects.
It's been like this for years. Haven't seen any changes.
It's been like this for years. Haven't seen any changes.
It has changed, I am to lazy to figure when exactly, but 38xx had the old version.
EDIT: Sorry for the claim of it being changed in version 38xx, it is actually also already this way in version prior to 2000. - So I have actually missed it back then already.
I have not found the iMAOnArray() function in the MQL5 Help. Is there a substitute for it?
No.
Check out my code that uses another coder's custom "iMaOnArray()" function as a substitute:
Code Base
Brooky Trend Strength for MT5
Ryan L Johnson, 2025.04.29 19:52
This indicator calls 3 other subwindow indicators. All files go in your Indicators folder.