![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
Hello.
Can you please explain why when creating a "Graphic Tag" object manually, it doesn't have the specified bmp file for on/off states?
Here's the code:
ObjectCreate(....);
.......
ObjectSetString(0, "ColorLabel", OBJPROP_BMPFILE, 0, "Images\on.bmp");
ObjectSetString(0, "ColorLabel", OBJPROP_BMPFILE, 1, "Images\off.bmp");
The label is created completely correctly, in the specified position, with specified colours, etc., but "Images\on.bmp" and "Images\off.bmp" are not specified. If in the MT5 gui
click on the list of objects and set these files for the marker manually, they will be set. But why doesn't ObjectSetString do that?
What do you think?
Where do you have these files? See example Demo_Create_OBJ_BITMAP_LABEL_EA
Thank you very much! The double slash helped.
Let me explain a little bit. I had an error because ObjectGetString returned a string with one slash, so I thought it should be placed in ObjectSetString too.
Thanks for the help.
Thank you very much! The double slash helped.
See Character Constants:
The backslash is a control character for the compiler when parsing constant strings and character constants in program source code. Some characters such as single quotes ('), double quotes ("), backslashes (\) and control characters can be represented by a combination of characters starting with backslashes(\) according to the table below:
Symbol name
Mnemonic code or image
Write in MQL5
Numeric value
Newline (line feed)
LF
'\n'
13
horizontal tab
HT
'\t'
9
carriage return
CR
'\r'
10
backslash
\
'\\'
92
single quote
'
'\''
39
double quote
"
'\"'
34
hexadecimal code
hhhh
'\xhhhhh'
1 to 4 hexadecimal places
decimal code
d
'\d'
decimal number between 0 and 65535
If a backslash is followed by a character other than those listed, the result is undefined.
Thank you!
I apologise a lot for the repetition, but I still haven't cleared up the navigation situation yesterday. Is this a bug and needs to be processed in servicedesk or is there a more correct code to emulate autoscroll on a given bar?
The attached video clearly shows that chart navigation is done from 2291 to 2286 bars, but in the first 30 sec (minute) of the video,
there is a jerking of the chart. Two days of catching the bug showed that the reason is in the navigation function, the code where the incorrect operation is pronounced I posted above.
I apologise a lot for the repetition, but I still haven't cleared up the navigation situation yesterday. Is this a bug and needs to be processed in servicedesk or is there a more correct code to emulate autoscroll on a given bar?
The attached video clearly shows that chart navigation is done from 2291 to 2286 bars, but in the first 30 sec (minute) of the video,
there is a jerking of the chart. Two days of catching the bug showed that the reason is in the navigation function, the code where the incorrect operation is pronounced I posted above.
We'll fix it. Wait for the next build.
OK, thanks for the answer.
I can't seem to attach the video.
Is this a bug or my lack of skill?
The chart jerks when navigating from zero bar. I purposely inserted slips between navigation and update to highlight the problem. But the bug exists even without slips. It turns out that ChartNavigate() first moves the chart to zero and then moves it back. In addition, it does not do this every time.
At least, the fact that the bug does not exist every time you call ChartNavigate(), it appears when you run it without slips.
I apologise a lot for the repetition, but I still haven't cleared up the navigation situation yesterday. Is this a bug and needs to be handled by servicedesk or is there a better code to emulate autoscroll on a given bar?
In general, it is better to write to Service Desk directly. It will be faster and more reliable.
Usually, if I am convinced that this is a bug, I do so. I will email Service Desk right away.
In this case, there was no such certainty. So I decided to clarify it here first, so as not to distract people.
Thank you again for your quick response.