Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1060

 
smart_man:
1. Thanks, but haven't found the answer. There's a SetOrder() function, but it's the same as OrderSend() in essence. You cannot open multiple orders at the same time with this function.

You cannot open several orders at the same time with any function, because the server executes the orders one by one, not in parallel, and the orders are from all clients, not just yours.

At best, the orders will be opened with a few milliseconds difference one after another, but only if there is some demand on the market.

 
evillive:

You cannot open several orders at the same time with any function, because the server executes the orders one by one, not in parallel, and the orders are from all clients, not just yours.

In the best case the orders will open with a few milliseconds difference one after another, but that's only if there is a demand on the market.

I can see that you have understood the problem! The only thing that comes to my mind is if we open these orders by pending. Is it then possible to open them at the same time?
 
smart_man:
There, I can see that you understand the problem! The only thing I can think of is if you open these orders in a pending way. Then is it possible to open them at the same time?
No, the server still executes them one by one, pending or on the market.
 
evillive:
No, the server will still execute them one by one, pending or market.

1. then the issue of "simultaneity" is removed. Then in this aspect there is no difference between opening a market or a pending one.

2. Is it correct to check manually on each tick if the order has closed, in order to catch the moment of this very closing (by TP or SL) or there are ready-made functions?

 
smart_man:

1. Then the question about "simultaneity" is removed. Then in this aspect there is no difference between opening market or pending.

2. Is it correct to check manually at every tick if the order has closed, in order to determine the moment of this very closing (by TP or SL) or are there ready functions?

2 Look carefully: https://www.mql5.com/ru/forum/131859

isCloseLastPosByStop();
isCloseLastPosByTake();
 
What does this line mean: PostMessageA(hwnd, WM_COMMAND, 0x822c, 0)? I can't find the purpose of it.
 

Can you advise which brokerage company to choose? Interested in problems with deposit/withdrawal as well as reliability of quotes. For example test results from Alpari server are very different from metaquotes in favour of the latter. Candlestick parameters on different servers have different values etc.

It is interesting that Alpari and the forex club did not have a license last week, there were searches of Teletrade. How to go on living?

 

Hi all. I want to make a fully autonomous custom function. No problem with OnInit() emulation. The user function itself is executed by definition. But I have problems with the pseudoOnDeinit(const int reason).

Clarifying the task. The user function must delete its graphical objects on the last pass and, for example, save some data in global variables of the terminal.

In a looped program, the sign of program termination may be IsStopped()==true. In a non-looped program, it's always=0. Not a universal method.

I tried calling the UninitializeReason() function from OnTick(). The result is always=0. Yet it would be logical to make it give the value of the reason for impending deinitialization on the last pass.

So, the UninitializeReason() function is truncated and can be used only inside OnDeinit(const int reason).

All user functions can be additionally specified in the OnDeinit(const int reason) deinitialization function and one of the mandatory parameters passed to the user function should be reason-the reasonfor deinitialization.

The presence of non-zero value passed from OnDeinit(const int reason) to the user function will be the sign of the main program's shutdown.

Perhaps there are other ways and system variables you need for this purpose. Write to me. Share your experiences. If you are not sorry. ;-)

 
kosmos0975:

I tried calling the UninitializeReason() function from OnTick(). The result is always 0, although it would be logical to make it give the reason for the upcoming deinitialization on the last pass.

How else could it be? If you close the terminal between ticks, OnTick() is not executed, and therefore no event that calls UninitializeReason() is handled.
 
AlexeyVik:
How can it be different? If you close the terminal between ticks, OnTick() will not be executed and therefore the event that calls UninitializeReason() will not be handled.
Please tell developers to make additional (bonus) tick. It would be very convenient. ;-)
Reason: