Questions from Beginners MQL5 MT5 MetaTrader 5 - page 218

 
micle:
The server side is just a gateway... I think in terms of order execution a lot depends on the broker and not on the server part.
Well, that's what I want to know for sure. If it is determined by the server side and the order of execution is guaranteed, then such constructs can be used in algorithms. If not, then you can't.
 
Algo:
Thanks for the insight, but the question was about something else.
As a matter of fact, the order queue is not guaranteed. Execution of limit orders is not guaranteed. In your example it would be either 0 or +3 contracts.
 
C-4:
On the subject, the order queue is not guaranteed. Execution of limit orders is not guaranteed. In your example it would be either 0 or +3 contracts.

How can it be "either 0 or 3" if the order of priority is not guaranteed? In the bylimit example, it really is not guaranteed - if the price goes below the bylimit, it is guaranteed to be executed, but the stop loss is not. Maybe not, because it takes time to activate and execute, and MT has already changed the stop-loss level to a new one. But okay, replace the bylimit in the example with a sellstop - then what?

This is a general question. When a stop order (whether it is a stop loss or a standalone sell order, it does not matter) is sent to the broker, it is placed in the order book. When the price reaches the level, is it guaranteed that the orders from the order book will be executed in the order they arrive in it? If the order book is part of the MT server, the developers may be able to answer that question. If not, and the order-book at the broker is handled by some other software and MT is only "notified" of all transactions, then really, I don't know.

 

Good afternoon. Could you please tell me if there is any way to adjust the lot volume while using someone else's signal? Apart from the function "Execute within:".

I came across this example: My signal provider has lots volume 0.40 and I have 0.1... leverage 1*100 for both of them, execute within: 5.0 worth. Does the volume of deposit affect me or something else?

 
539exnkx:
The author is not known, but can I describe the strategy myself or is it easier to reorder the robot?

There are two options here:

  1. Write the code yourself
  2. Order the code.

 
Algo:

How can it be "either 0 or 3" if the order of priority is not guaranteed? In the bylimit example, it really is not guaranteed - if price goes below the bylimit, it is guaranteed to be already executed, but the stop loss is not. Maybe not, because its activation and execution take time, and MT has already changed the level of stop-loss to a new one. But okay, replace the bylimit in the example with a SellStop - then what?

In a nutshell, the question sounds like this. When you send a broker a stop order (whether it is a stop loss or a sell order, it does not matter), it will be placed in the order book. When the price reaches the level, is it guaranteed that the orders from the order book will be executed in the order they arrive in it? If the order book is part of the MT server, the developers may be able to answer that question. If not, and the order-book at the broker is handled by some other software and MT is only "notified" of all transactions, then really, I don't know.

Let me explain in simpler terms. You have a stop order at 1.3000. After the price reaches 1.3000, the stop order will execute, and let's say at the same moment the price moves back to 1.3001. It does not matter how long the stop order is executed, 100 milliseconds or 100 seconds. The important thing is that it will be executed. In this case, by the time the order is executed, the price will already be 1.3001, so your stop will have a positive slippage. But the buy limit at 1.3001 will never be executed.

Bids are executed according to the FIFO principle: first came, first executed. However, you can't use this feature in your algorithms. There is no guarantee that the order execution time available in the history of trades will also comply with this principle.

 
C-4:

Let me make it simple. You have a stop order at 1.3000. Once the price reaches 1.3000 the stop order will start executing, let's say at the same moment the price moves back to 1.3001. It does not matter how long the stop order is executed, 100 milliseconds or 100 seconds. The important thing is that it will be executed. In this case, by the time the order is executed, the price will already be 1.3001, i.e. your stop will have a positive slippage. But the buy limit at 1.3001 will never happen.

I wrote in my comment "if the price goes below the bylimit". Replace the price with 1.2999 (the bylimit was 1.3000) in your example, and further calculations will immediately change.
C-4:
There is no guarantee that the time of execution available in the history of trades will also comply with this principle.
Exactly, that's exactly the question. Do you know for sure that there is no such guarantee, or are you just assuming?
 
ViktorK:

Good afternoon. Could you please tell me if there is any way to adjust the lot volume while using someone else's signal? Apart from the function "Execute within:".

I came across this example: My signal provider has lots volume 0.40 and I have 0.1... leverage 1*100 for both of them, execute within: 5.0 worth. Does my deposit volume affect me or something else?

Yes, it affects the deposit size. What is yours and the Provider's? When you signed up did you put 95% utilization of your deposit?

Example 1) Your leverage is the same (1:100 or 1:500 it does not matter), the provider has a depo = 10000$, you = 5000$ and at subscription you have chosen 95% of your deposit usage. Provider opens a position with 0.40 lots, you will get 0.19. Your lot is calculated as: 0.40 / 2 = 0.20 (because your deposit is half the size) and take 95% of 0.20 = 0.19.

Example 2) Provider has leverage = 1:500 and deposit = 10000$. You have leverage = 1:100, a deposit of 5000$ and use 50% of your deposit. His lot = 0.40. Your lot is calculated as: 0.40 / 2 (as your deposit is 2 times less) = 0.20, then 0.20 / 5 (as your leverage is 5 times less) = 0.04, then 0.04 / 2 (as you use 50% of your deposit). = 0.02.

 
paladin800:

Yes, the value of the deposits has an impact. What is yours and the provider's?

Yes, most of my deposit is bonus funds, so they don't seem to count and don't participate in drawdowns.

Thanks for the info, will look into it)

 
ViktorK:

Yes, most of my deposit is bonus funds, so they don't seem to count or participate in drawdowns.

Thanks for the info, will look into it)

In my opinion, the fact that part of your deposit is bonus funds should not affect you. Although anything is possible. By the way, ask your broker if bonuses are used when calculating the lot if you signed up for a signal. And if you don't mind, let me know what the broker's response was, it's very interesting.
Reason: