Errors, bugs, questions - page 575

 
Karlson:
If we sit around and talk demagogy )), we'll wait for the consequences of Eurochif... and la-la...

What's wrong with the consequences of Eurochif?

papaklass:
"Give me the full list, please."
+1
 
My proposal is to keep up with the times, to write something that is realistic at this stage, that is, I'm against the phrase "You shouldn't write a multithreading, because there is no multithreading.The only thing you need to do when you trade with 1-3 spread potential (up to 10-20 points of 4-digit spread), and if you don't like it - one tick is enough for a fast pair or even a one-minute bar for a poll.
 
Interesting:

What's wrong with the aftermath of EUROCHIFA?

The buck-chief... There's no point in trading it if the Eurobucks is already trading... Then there's the possibility of a crisis... Many things are possible, up to and including regulation of other currencies...
 
papaklass:
Yes, until OnTick() and OnTrade() event handlers and multithreading in EAs become parametric, the normal multithreading will be just a dream. All this stuff - OnChartEvent() etc. is nonsense. It's an attempt to replace the parametrization of the main event handlers. And while MQ will be engaged in such nonsense, instead of solving the issue cardinally (parameters of event handlers and multithreading) MT5 will be on the same level where it is now. And there are no special prospects for this platform in its current form. (Not visible to traders).

You just don't realise the level of problems for different classes of users, the internal processes from implementing multithreading for MQL5 and the global implications for the platform.

Think about it for a week, find five deadly conditions, and then you can publish specifics.

We engaged in such analysis many times and for a long time, thanks to the fourth generation of the language.

 
papaklass:
The terminal allows you to open 99 charts. And wait for the next pair to see what's going on there? And if you analyze on minute bars in such conditions, you will get access to the instruments an hour and a half after the last polling. Is that ok with you? And how do people manage to analyse hundreds of charts (for the stock market). And MT5 is positioned as a stock terminal too. So there are such pies. So without multithreading and parametricity of event handlers there is nowhere. Or trade on 1 - 12 pairs.

You are fundamentally mistaken in not knowing that:

  • each EA/script runs in its own thread independently of the others
  • every chart has its own independent queue
  • each symbol has its own execution thread when working on charts; all indicators of this symbol are calculated in this thread, without affecting the processes of other symbols' indicators
  • the terminal has many system threads that do their work independently of each other and untie bottlenecks

Unfortunately, statements "give me multithreading and basta" do not mean that you really understand the existing processes. We have worked very well on the internal processes in the terminal and implemented a very productive and consistent system.

 
Loky:

There is nothing clear-cut about this implementation. Interesting correctly articulated the problem in the previous post.

" The language itself (the concept of MQL itself) does not allow to organize processing of multiple threads within a program"

Once the OnChartEvent() function runs for execution and while the code for processing the event of arrival of a new tick of one of the pairs is executed, all other pairs with their onTick events will have a rest!

Do you really need high-frequency trading above 1 second?

I think not, then in OnChartEvent() open only flags of state, and there will be no delay, and move calculations themselves to OnTimer() and process only those flags which are open.

 
Urain:

Do you really need high-frequency trading above 1 second?

I think not, then in OnChartEvent() open only flags of state, and there will be no stream delay, and the calculations themselves move to OnTimer(), and process only those flags, which are open.

1. and how will this design work in the tester?

2. I need a trade with frequency no less than the arrival of a new quote on a pair. I may be analysing the time between quotes and their quantity in a certain interval.

I would like "calculations" to be performed for two different pairs at the same time.

3. I would like to have a totally different concept of toolkit. Binding to the EA chart is very annoying. I wish it were on the level of visualization of objects, their properties and events in the terminal window.

For example

- selected a symbol in the quotes window, click left mouse button -> properties ->

then observe list of events -> select ontick twice with left mouse button -> a window opens for entering mql5 code

Similarly, for other terminal objects - charts, indicators, etc.





 
Loky:

1. how will this design work in the tester?

2. I need to trade with a frequency not less than a new quote arrives for a pair. I may be analysing the time between quotes and their number in a certain interval.

I would like the "Calculations" to be performed for two different pairs at the same time.

Since the calculations will take place in OnTimer() there will be no simultaneous processing, only sequential.

In this case, the queue of events will not accumulate. Events of the ticks from different pairs that come during OnTimer() calculation will be skipped.

 
papaklass:
.....

I think you are taking too much on yourself. At the very least, you should have been more polite.

If you have problems with the terminal or the execution of MQL5 programs, then contact the right place - servicedesk. It will be much more helpful.

 
papaklass:

1. Why are all the open charts with indicators in the terminal online running on one core? I have 4 cores on my computer and three are idle. May be the cloud is to blame for such performance?

Gonewo. Pruf - please, let's see.

2. Why does the multi-currency Expert Advisor process ticks from each chart sequentially, and not from several symbols at once?

Does it have to? And what is the problem with passing the necessary events from the spy indices? Well, not the ticks, of course, but signals, of course. And the EA has one thread and does not need more.

We don't need any more pain and snares with synchronization and deadlocks. At least master OOP and then ask for multithreading.

Maybe, I have organized the EA incorrectly and there are functions in MT5 that allow using all cores? If so, explain what these functions are and how to use them.

Why does the Expert Advisor need to use all cores?

You don't even have to worry about multithreading. The Expert Advisor is a spy and Expert Advisor-synchronizer. Most of the functionality is performed by the spies and the synchronizer is responsible for correct exchange of dependent data between the spies.