[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 381

 

Synchronisation is also a relative concept. Synchronisation of what with what? Synchronization for atomic access? And who will build the queue? Junko, maybe your library builds the queue normally, if the code is taken from MSDN, because everything is done correctly there. And you just copied it without understanding what it does - like a monkey's glasses. Or maybe you're just making it up as you always do. Because you don't understand. You confuse synchronization for atomic access with queuing.

 
Sepulca:
Bought a lot of processor cores. And now which one to queue up for)))))))))

Nope, that goes for single core processors too, multitasking is a function of the operating system.
 
Chiripaha:

I checked with increasing PauseBar and got just these sticks on the 1 and 5 minute bars. But I don't understand how to bypass them correctly. I understand what needs to be written, probably (but not obviously) if the value

в

the value of the previous bars - something like this:

But when I try to do it, my whole indicator "moves" - because I don't understand the logic and I don't understand where to put it and under what conditions.


This variant works adequately in the tester.
I have worked around it like this:

        if(FirstChanel) 
        { 
          if(Up[i-2]==0 && Down[i-2]==0)
          {
            Up[i-1]   = high;   
            Down[i-1] = low; 
          } 
          else
          {
            Up[i-1]   = Up[i-2];   
            Down[i-1] = Down[i-2]; 
          }  
        }

And wherever there was [i] shifted back 1 bar

And here:

   Comment("DrawChannel =",DrawChannel,"\n",
           "limit =",limit); // изначально значение было равно 1
  
   limit = Bars-IndicatorCounted()-1; 
   if(limit >= 1)                    limit = Bars-1; // и это условие не выполнялось, поставил >= и начало считать
Files:
 
Good day. I wandered around the forum but did not find a definite answer, is it possible for my Expert Advisor to work with several currency pairs at once? I think some sites that sell EAs have such possibility in their descriptions, but I want to make sure. I have already started working with some forex pairs and I don't know how to start trading.
 
Trendy:

I wandered around the forum but did not find a definite answer, is it possible for an EA to work with several currency pairs at once?

I think some sites that sell EAs have such possibility in their descriptions, but I want to be sure.

it is possible. the advisor is limited only by the number of symbols of your brokerage company.

If you have not found the answer, because your question is stupid in essence.

If you can, please send us a link about how to do it

https://www.mql5.com/ru/code
 
Integer:


1. You must be having trouble understanding it. I know what you're talking about.

2. Thanks, but I didn't ask for advice. Especially since we are talking about synchronization of what is no longer in the same thread.

And what is the science of synchronization? What science? Your own science? Someday you will understand it, but there is nothing complicated about it. Programming languages and algorithms were not invented and created by fools. But for some reason they are provided with means of synchronization and queuing.

4. very wrong. If correct....If there was synchronicity. But in that code you cited here a bit earlier there is no synchronicity, only atomic access.

3. According to the science of system programming. Read Richter. He'll enlighten you on queues.

4. What is synchronization? It is atomic access to a resource. My code provides it. The queue is built by the system. The modules are executed proportionally to the time of their execution. The order of execution is not important. Everything is done by the system. This is not an invention of fools. Try to prove the contrary using a concrete example. Analyze the log. You will see that everything is executed correctly, without your special queues.

By the way, MQL4, as a language, has a function with atomic access. There are none of them in C++. You have to write them yourself, as wrappers of WinAPI-functions. It is better to implement it in a class.

Integer:

Once again, just in case, for those who are in a submarine in a tank and still wear a helmet. Only atomic access is shown here. The order of functions here will be as the wind blows. This code does not provide for uniform execution of functions. That's why there is no guarantee that a function won't stay on the shelf for a very long time. Relying on serviceability in programming only because the processor's frequency is high is ridiculous, even if the processor's frequency is very high.

Once again for those who are not in the tank. The system provides the execution order. What is uniform execution? How can you provide uniform execution of threads which execution time and number are not known? Why bother with it? They have already thought of it for you and have done it. You may use synchronization objects.
Of course, I don't exclude cases when you need a special thread queue to execute the threads. This is a very tricky thing :-)) You should avoid such code. For there is a paradox here. Why should you execute a task in several threads to get them all into one? You should use single-threaded execution. You won't need synchronization then.

There is one more case when you need a queue. But not the queue of threads' execution, but the order of processing the data received from threads (threads' results). This is the most frequent task for queues.

Integer:

Synchronization is also a relative notion. Synchronization of what with what? Synchronization for atomic access? And who will build the queue? Junko, maybe your library queue is built normally, if the code is taken from MSDN, because everything is done correctly there. And you just copied it without understanding what it does - like a monkey's glasses. Or maybe you're just making it up as you always do. Because you don't understand. You confuse synchronization to provide atomic access and queuing.

And again, for those who... :-))

Synchronization is providing atomic access to a resource. The queue is built by the system. Execution is guaranteed, order is not. In MSDN, the code is probably correct, but awkward. Write your own class for convenient synchronization. I wrote my class by the principle of Andrei Postnikov's class. He kindly showed me how to synchronize it correctly. True, it is not one class. I got a class for every object of synchronization, one more lock class for everything and a namespace for waiting functions.
Actually, I've already answered everything above.

 

Junko, you are hopeless. If it's hard for you to think, don't think, spit on it altogether, it's not your thing...

If something was unproven and unproven, you wouldn't be arguing about it. The problem is that you, Vadim, are incapable of having a constructive conversation. At least you confirm that synchronization is only for atomic access and not for queuing. You, Vadim, are now arguing with yourself without realizing it.

 
Integer:

Junko, you are hopeless. If it's hard for you to think, don't think, spit on it altogether, it's not your thing...

If something was unproven and unproven, you wouldn't be arguing about it. The problem is that you, Vadim, are incapable of having a constructive conversation. At least you confirm that synchronization is only for atomic access and not for queuing.

How can I... I am not a programmer, like some people :-))
 
Zhunko:

Synchronisation is the provision of atomic access to a resource.
The queue is constructed by the system.


A big round of applause! On the subject of the code from page 378. Even if the terminal regulates the queue order, it cannot know in which case the function was executed and in which case it was rejected.
 
Also, about regulation by the system. If more than one stream is created, yes, the system will regulate. But if someone from the side is involved in these streams, then you have to think about everything yourself, there will be no miracle from the system.
Reason: