Discussion of article "Graphical interfaces X: Advanced management of lists and tables. Code optimization (build 7)" - page 4

 
Anatoli Kazharski:

Through events, then. But not through a timer with such a frequency. In general, the brakes are on your side, not on the library or video recording side. I have no more questions.

It's clear that the brakes are on my side - don't be so vulnerable (you try to defend yourself ;)). But the fact that there are no such brakes without video recording is a fact. They are there, but small.

How can you organise an event model without a timer when trying an unknown number of characters? OnTick()will not allow you to timely detect the required event on a "non-native" symbol.
So - only to browse through the timer in a loop all the required symbols, define the criterion and send the event. Then already process the event.
I thought about this already. You can't get rid of the loop through the characters in the timer with control of the required criteria anyway. And event processing does not take much time. Although it will slightly relieve the timer. I will try it of course - I was already going to try it.

 
Artyom Trishkin:

...

How to organise an event model without a timer when searching an unknown number of characters? OnTick()will not allow you to determine the required event on a "non-native" character in time.
So - only look through the timer in a loop through all the required characters, determine the criterion and send the event. Then already process the event.
I thought about this already. You can't get rid of the loop through the characters in the timer with control of the required criteria anyway. And event processing does not take much time. Although it will slightly relieve the timer. I'll try it of course - I was already going to do it.

And how many characters were in the processing when recording video?

This option is not suitable? >>> MQL5 Recipes - Multicurrency Expert Advisor: an example of a simple, accurate and fast scheme. If not, why not?

 
Artyom Trishkin:


How to organise an event model without a timer when searching an unknown number of characters? OnTick()will not allow you to timely define the required event on a "non-native" character.
So - only to view all required characters through the timer in a loop, define the criterion and send the event. Then already process the event.
I thought about this already. You can't get rid of the loop through the characters in the timer with control of the required criteria anyway. And event processing does not take much time. Although it will slightly relieve the timer. I'll try it of course - I was already going to try it.

At one time, I studied the time intervals between incoming ticks for some reason. I was looking for some patterns. I spent weeks on it. I can say that the observed flows of ticks came with a frequency not higher than 90 - 100 milliseconds.

If you need to check a lot of instruments for ticks, I think there is no sense in doing it more often than once every 100 milliseconds. I don't think that there is asynchrony in ticks arrival between instruments, which would make it necessary to increase the check frequency up to the maximum 16 ms.

You can easily check whether there is asynchrony in ticks arrival on instruments, which raises the total tick frequency to 16 ms with Alert.
 
Anatoli Kazharski:

And how many characters were in the processing when the video was recorded?

Is this variant not suitable? >>> MQL5 Recipes - Multicurrency Expert Advisor: an example of a simple, accurate and fast scheme. If not, why not?

The total number of symbols involved was about 13 out of 34 - the presence of a signal on the symbols is first determined there, the ones with a signal are selected, and these are the ones that participate in the search in the timer - the price crossing the required levels is looked for.

I was wondering why I need to search for a new bar for each of the symbols present in the Market Watch - it is an unacceptable waste of resources when only three tf's are used - daily, weekly and monthly. We need some other algorithm. But again - independent of ticks of the current symbol.

As for the proposed event model, I have already practised it, but only in cases when charts were open. But this way I will have to add an agent for each necessary symbol (not known in advance), which will send events - won't it require evenmore resources?

 
Artyom Trishkin:

The total number of symbols involved was about 13 out of 34 - there the presence of a signal on symbols is determined first, the ones with a signal are selected, and these are the ones that participate in the search in the timer - the price crossing of the required levels is searched for.

I was wondering why I need to search for a new bar for each symbol present in the Market Watch in the timer - it is an inadmissible waste of resources when only three tf's are used - daily, weekly and monthly. We need some other algorithm. But again - independent of ticks of the current symbol.

As for the proposed event model, I have already practised it, but only in cases when charts were open. But this way I will have to add an agent for each necessary symbol (not known in advance), which will send events - won't it require evenmore resources?

I can't say for sure what the result might be in the end. I have to test it. I'm busy myself, so if you do it, please demonstrate it later if you have a free minute. Very interesting.

Now I am working on a multi-line input field(CTextBox) without restrictions. It will be almost analogue to the Windows application "Notepad". )

 
Anatoli Kazharski:

I can't say for sure what the result will be in the end. I have to test it. I'm busy myself, so if you do it, please demonstrate it later if you have a free minute. Very interesting.

I am working on a multiline input field(CTextBox) without restrictions. It will be almost analogue to the Windows application "Notepad". )

Okay, we'll see what the result will be.

Interesting input field - let's see ;)

 
Artyom Trishkin:

I was wondering why I need to search for a new bar for each of the symbols present in the Market Watch in the timer - this is an inexcusable waste of resources when only three tf's are used - daily, weekly and monthly. We need some other algorithm. But again - independent of ticks of the current symbol.

The theoretical time of the next bar appearance is known. And it is the same for all instruments.

You can check whether a bar has really appeared on the working list of instruments only when this estimated time comes.

 
Andrey Khatimlianskii:

The theoretical time of appearance of the next bar is known. And it is the same for all instruments.

You can check whether a bar has really appeared on the working list of instruments only when this estimated time comes.

Yes, Andrei, it is known. But it is different for different markets. On Forex it is one thing, on stocks it is quite different. I would not like to introduce manual control of this time. I would like it to be able to determine new bars on any markets by itself, without specifying the time from which it should start waiting for their occurrence.

And, yes, not on every symbol of the same market a new bar comes at the same time as the others - as the first tick comes. This means that you need to wait for the appearance of new bars on all symbols for some time.

 
Artyom Trishkin:

Yes, Andrei, it is known. But it is different for different markets. In forex it is one thing, in stocks it is quite different. I would not like to introduce manual control of this time. I would like it to be able to determine new bars on any markets by itself, without specifying the time from which it should start waiting for them.

And, yes, not on every symbol of the same market a new bar comes at the same time as the others - as the first tick comes. And it means that you should wait for the appearance of new bars on all symbols for some time.

Well, yes, somewhere and at 11 am a bar can appear, checking from 00:00 is not an option.

Then the easiest thing is to put the check of a new bar in a separate second timer (more often there is no sense, as far as I am concerned).

 
Andrey Khatimlianskii:

Yes, a bar may appear somewhere at 11am, checking from 00:00 is not an option.

Then the easiest way is to put the check of a new bar in a separate second timer (more often there is no sense, as far as I am concerned).

In the symbol specification there are its sessions - quote and trading. Probably we should try to start from them....