Errors, bugs, questions - page 2226
![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
Waiting in the KB ;)
The solution turned out to be much simpler than I thought.
An example of indicator, in which you can find out Timer's status. You just need to add one line #include <Timer.mqh> and OnTimer() under control.
And here is the class itself:
Result:The solution was much simpler than I thought.
...
I wanted to write about the level of coding in the community in general, but let's omit to avoid trouble...
In my opinion, a good way to solve the problem is to implement a singleton or static class, which implements timer control and provides the ability to "subscribe" to a timer event,
"subscription" is implemented by passing a pointer to a function to be called at certain intervals.
The trading results are different from the test on all ticks. Can you tell me where to dig - are the quotes overdrawn or what?
All ticks test - always gives the same result. Real trade - gives us extra trades on the same period.
The Expert Advisor has not turned off for 2 weeks. The test has also been running for 2 weeks. I have run it 50 times - it always gives the same result.
The trading results are different from the test on all ticks. Can you tell me where to look - are the quotes overdrawn or what?
All ticks test - always gives the same result. Real trading - gives extra trades on the same period.
The Expert Advisor has not stopped for 2 weeks. The test has also been running for 2 weeks. I ran it 50 times - it was always the same
Is the test performed using "all ticks" or "real ticks"?
For all ticks - topmost parameter
In "All ticks" mode, the ticks are modelled by the tester from the minute bars. Here is an article about the different test modes. https://www.mql5.com/ru/articles/2612
I wanted to write about the level of coding in the community in general, but let's omit to avoid trouble...
In my opinion, a good way to solve the problem is to implement a singleton or static class, which implements timer control and provides the ability to "subscribe" to the timer event,
"subscription" is implemented by passing a pointer to a function to be called at certain intervals.
You must be a very good programmer if you say such sensible things. And thanks for the political correctness :)).
I certainly have a vision of how to create a handy polytimer. Your view has expanded my vision even further. Thank you.
the problem is solved through the implementation of a singleton
Error in FileLoad. If two local Agents with FILE_COMMON flag try to read data through FileLoad, one of the Agents fails.
It is possible to set appropriate flags in FileOpen, but not in FileLoad. Therefore, please allow access to the file via FileLoad if another FileLoad reads it.
How can these flags help you? Here is an examplehttps://www.mql5.com/ru/forum/1111/page1628#comment_2702870
Two Expert Advisors try to read datavia FileOpen (with the flag FILE_SHARE_READ ). Result:One of the Expert Advisors crashes