Errors, bugs, questions - page 1178
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
No, I need to set it manually and check it programmatically.
Like this:
If the visibility flag on H1 is set, it will be true.Then you have to read the visibility flag and do a logical & with the constant.
If you mean:
Or
Same thing.If you mean:
Or
Same thing.If you mean:
Or
Same thing.Your mistake here is bool(res), since res is always greater than 1 in any mapping, see what is returned in res, thus bool(res) will only return 0 or false when res=0
You are using type conversion and comparison inattentively
OBJ_NO_PERIODS
0
Object is not shown at any timeframe
OBJ_PERIOD_M1
0x00000001
Object is plotted on 1-minute charts
OBJ_PERIOD_M2
0x00000002
Object is plotted on 2-minute charts
OBJ_PERIOD_M3
0x00000004
Object is plotted on 3-minute charts
OBJ_PERIOD_M4
0x00000008
Object is plotted on 4-minute charts
OBJ_PERIOD_M5
0x00000010
Object is plotted on 5-minute charts
OBJ_PERIOD_M6
0x00000020
Object is plotted on 6-minute charts
OBJ_PERIOD_M10
0x00000040
Object is plotted on 10-minute charts
OBJ_PERIOD_M12
0x00000080
Object is plotted on 12-minute charts
OBJ_PERIOD_M15
0x00000100
Object is plotted on 15-minute charts
OBJ_PERIOD_M20
0x00000200
Object is plotted on 20-minute charts
OBJ_PERIOD_M30
0x00000400
Object is plotted on 30-minute charts
OBJ_PERIOD_H1
0x00000800
Object is plotted on 1-hour charts
OBJ_PERIOD_H2
0x00001000
Object is plotted on 2-hour charts
OBJ_PERIOD_H3
0x00002000
Object is plotted on 3-hourly charts
OBJ_PERIOD_H4
0x00004000
Object is plotted on 4-hourly charts
OBJ_PERIOD_H6
0x00008000
Object is plotted on 6-hourly charts
OBJ_PERIOD_H8
0x00010000
Object is plotted on 8-hour charts
OBJ_PERIOD_H12
0x00020000
Object is plotted on 12-hour charts
OBJ_PERIOD_D1
0x00040000
Object is plotted on daily charts
OBJ_PERIOD_W1
0x00080000
Object is plotted on weekly charts
OBJ_PERIOD_MN1
0x00100000
Object is plotted on monthly charts
OBJ_ALL_PERIODS
0x001fffff
Object is plotted on all timeframes
There you go:
If the visibility flag on H1 is set, it will be true.As a continuation of my previous post, I managed to find the problem area causing the bug using the scientific method.
We have a library with this function:
Here is the main file:
The resulting Expert Advisor does not work and displays in the log: "EX5 loading failed".
Hi. I locked the EA in OnInit function and it must be the reason why the terminal hangs when I turn off the EA and change timeframe (timeframe does not change after the brakes). So my question is: Is it caused by hangs? If so, is it corrected if I move the algorithm to OnTick? If no, what would help?
PS: The loop has a function Sleep, so that the terminal is not overloaded. The input fields are read in the loop.
Hi. I locked the EA in OnInit function and it seems that when I turn off the EA and change timeframe the terminal hangs (timeframe does not change after the brakes). So my question is: Is it caused by hangs? If so, is it corrected if I move the algorithm to OnTick? If no, what would help?
PS: The loop has a function Sleep, so that the terminal is not overloaded. The input fields are read in the loop.
Hi. I locked the Expert Advisor in OnInit function and it seems that when I turn off the EA and change timeframe the terminal hangs (timeframe does not change after the brakes). So my question is: Is it caused by hangs? If so, is it corrected if I move the algorithm to OnTick? If no, what would help?
PS: The loop has a function Sleep, so that the terminal is not overloaded. The input fields are read in the loop.
OnInit - serves only for initialization. All calculations must be done further - OnTick, OnTimer etc.
If you need to know the change in the input field, there is a standard library for that: https://www.mql5.com/ru/docs/standardlibrary/controls/cedit