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
And have you asked a new question yet?
It's not appropriate for a moderator to start a flood. To clarify. When a user (including a moderator) adds a new post to a thread, it is common to call it a "reply". Even if it is a rejoinder of a sarcastic nature.
Therefore, once again, with a clarification: If you perceive it as a circus, feel free to delete it, or try to submit a new message on its merits. Inaccurate information, on the other hand, can mislead users.
To add. I'll be the first to thank you if it officially turns out (if you help to find out) that user events fill the queue according to the old rules.
I'll add. I'll be the first to thank you if it turns out officially (if you help to find out) that custom events fill the queue according to the old rules.
Roughly speaking, the handling of events has never changed. It's just that it wasn't originally written correctly in the help.
...
I actively use the idle message created in each of my applications. Everything works.
I actively use the idle message created in each of my applications. Everything is working.
sergeev:
I have caught a bug.It happens due to sending of the EventChartCustom event from the Expert Advisor to itself. It turns out that this sending of event causes the main window to update the chart (ChartRedraw).
//---
I made such an expert to test your solution and at the same time tried to solve the problem with super frequent flickering of text while editing an OBJ_EDIT object.
//---
//---
After launching the Expert Advisor, you will see the following on the chart in the upper left corner:
//---
By clicking on the"START event_idle++" button you will access your(Alex) solution. We see the event_idle++ counter increment right on the chart.
As long as the button is pressed your code will work. But it consumes a lot of resources. CPU load (tested on dual core) ranges from ~90% to ~100%. CPU load ranges from ~5% to ~10% before start or when button is released. Clicking (left-clicking) on the graph resets the counter to zero.
Entering text in the input field doesn't cause flicker, because at the moment of input your code is disabled by the"On/Off event_idle++" global variable. It's a crutch of course, but as a temporary solution it's fine for some simple solutions.
CPU load is not the only problem. When the counter is running, windows in the trading terminal open quickly but window resizing slows down quite noticeably. Not always, but such moments are there.
CPU load is not the only problem. When the counter is running, windows in the trading terminal open quickly, but window resizing slows down quite noticeably. Not always, but there are such moments.
CPU load problem can be solved as follows. Specify that the event counter is updated once per second. We add the following code:
In OnInit():
//---
In the program body:
//---
To Alex's code (marked in red):
//---
InCHARTEVENT_CLICK event handler block(marked in red):
//---
CHARTEVENT_OBJECT_CLICK event handler block should be edited as follows + Button state should be checked all the same, because sometimes even pressing it "wrongly" will leave it depressed, if it was like that before, but the rest of code in the block will work out and confusion will start:
//---
Now it gets more interesting. :)
//---
P.S. If you have a lot of seconds, you can try fiddling with GetTickCount().
What can I say
1. it ' s a burden on the CPU. Remove it and it will be quiet.
2. The idle loop itself has no noticeable effect on the CPU.
3. The problem with flickering of the edith is not a problem with a single 0-chart. It is a problem with sending an event to the object-chart. This causes the main 0-chart to redraw and gives flicker.
What can I say
1. it's a burden on the CPU. Remove it and it will be quiet.
2. The idle loop itself has no noticeable effect on the CPU.
3. The problem with flickering of the edith is not a problem with a single 0-chart. It is a problem with sending an event to the object-chart. This causes the main 0-chart to redraw and gives flicker.