Errors, bugs, questions - page 399

 

papaklass, thanks for the reply!

Example (I'll probably repeat myself):

Minimum lot = 1.0; minimum lot step = 0.1. The quote starts to fall, the trader tries to close a long position of 10.1 lots. In case of a news market, the order ORDER_FILLING_AON may not be executed. It is more reasonable to use the RDER_FILLING_CANCEL. The opposite Sell trade is partially executed (by 10.0 lots). The remaining part of the long position (0.1 lot) continues to incur losses. It cannot be closed because the minimum lot of the trade = 1.0 lot. I.e. in order to exit the market completely, the trader must:

1. To incur obvious losses buying at least 1.0 lot.

2. Try to execute a sell trade of 1.1 lot with the ORDER_FILLING_AON parameter.

So, in terms of common sense, entering ORDER_FILLING_CANCEL andORDER_FILLING_RETURN imposes a strict requirement for the values of the minimum lot and the minimum lot increment, they must be equal.

Another example.

There is a long position with 1.0 lot and SL/TP are set. Trader tries to make a reverse trade (sell) in volume of 1.1 lot with specified SL/TP (for sell).

Suppose that such volume is available in the market and the resulting position would be - sell volume of 0.1 lot with a specified SL/TP (for sell).

But there is no such volume and we have ORDER_FILLING_CANCEL? We will get an error about wrong SL/TP. Hence, let's say modestly, the wisdom is to send SL/TP = 0 in cross trades with the ORDER_FILLING_CANCEL parameter.

I know many MQL5 programmers are smart people, but I believe it would be good to get an article from the developers explaining the algorithm of order placing correctness verification.

I will repeat my question. Does such an article exist? If not, do you hope it will appear soon?

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 
papaklass:

When an order is executed, the volume of the remaining position cannot be less than the minimum.

How can you be so sure?

One post above gave an example (the first) of a case where such a situation is possible.

Either the server has a special feature that prevents you from partially closing an order so that the remainder is less than the minimum lot. Where is this explicitly written in the documentation?

 
voix_kas:

How can you be so sure?

One post above gave an example (the first) of a case where such a situation is possible.

Either there is a special rule on the server that does not allow you to close orders partially. the feature Or, there is a special code that prevents an order from being partially closed to keep the balance below the minimum lot. Where is this explicitly written in the documentation?

This is exactly what is written on the server (as in the last instance). Perhaps the terminal will also react in time to prevent an obviously erroneous operation.

By all logical rules it is impossible to make the transaction in volume less than the minimum and such transaction which will change/expose volume of an item to that which is less than the minimum lot.

 
Interesting:

This is exactly what is specified on the server (as the final authority). Perhaps the terminal will also react in time to prevent an obviously erroneous operation.

By all logical rules, it is impossible to execute a deal with a volume less than the minimum lot and such a deal that will change/expose the volume of the position to that which is less than the minimum lot.

What and where exactly is "on the server..." written?

There's one bad thing about your posts: speculation. Sorry for the direct opposition. :-)

Give me a specific link in the documentation where it is explicitly written: it is forbidden to partially execute a trade so that the balance is less than the minimum lot.

 
voix_kas:

What exactly and where does it say "on the server..."?

There is one bad thing about your posts: speculation. Forgive me for my direct opposition. :-)

Give me a specific link in the documentation where it's explicitly written: prohibit partial execution of a trade so that the balance is less than the minimum lot.

Try at Alpari (if I'm not mistaken their minimum lot is 0.10) with a script without any checks to open a lot of say 0.01.

See what the response (information in the structure) returns on this account.

You can also try to run the Expert Advisor with 0.01 lot in the Strategy Tester on the accounts of 2010.

After that we will continue the substantive conversation about what and where is possible.

voix_kas:

Give me a specific link in the documentation, where it is clearly written: it is forbidden to partially execute a trade so that the balance is less than the minimum lot.

Can a hydrogen atom be smaller than a hydrogen atom. it can probably, but that would no longer be our universe or "our" physical laws...

And which section of the documentation should say this in "ABC" or "Fundamentals of Mathematics"?

Sorry for the direct opposition. :-)

Automated Trading Championship 2010
  • championship.mql5.com
Automated Trading Championship 2010
 
Interesting:

Try on Alpari (if I'm not mistaken, they have a minimum lot of 0.10) with a script without any checks to open a lot of say 0.01.

See what is returned in the response (information in the structure).

You can also try to run the Expert Advisor with 0.01 lot in the Strategy Tester on the accounts of 2010.

After that we will continue the substantive conversation about what and where is possible.

Sorry for the direct opposition. :-)

Dear Sir, you read my question.

I am not asking if it is possible to make a trade with a volume that is less than the minimum set lot on a particular account/account type. Of course not.

My question is this: From the point of view of the MQL5 concept, is it acceptable to execute a trade with a partial lot less than minimal acceptable lot? (Of course, we are talking about ORDER_FILLING_CANCEL andORDER_FILLING_RETURN).

And we are not talking about empirical conclusions, but about specific requirements/limitations in the MQL5 "engine", which have been officially published.

 
voix_kas:

Dear Sir, you read my question.

I am not asking if it is possible to make a trade with a volume that is less than the minimum set lot in a particular account/account type. Of course not.

My question is: from the point of view of the MQL5 concept, is it acceptable to execute a trade with a balance of less than the minimum acceptable lot? (Of course, we are talking about ORDER_FILLING_CANCEL andORDER_FILLING_RETURN).

And we're not talking about empirical conclusions, but about specific requirements/limitations in MQL5 "engine" that have been officially published.

I just checked it manually, everything closes fine. I opened buy 0.21 lot and closed sell 0.2 lots, buy remains in the market 0.01 lot though the minimum was 0.1 lot. I checked it on quadruple one and there are no errors in partial closing there as well.
 
papaklass:

When an order is executed, the volume of the remaining position cannot be less than the minimum volume. It will be a multiple of the minimum volume, but not less.

Give me an example of how you can change a position by 0.01 lot, with the minimum possible lot being 0.1. Then you will answer your own question.

Your interpretation is clear. But look at the documentation:

SYMBOL_VOLUME_MIN Minimum volume for a trade

SYMBOL_VOLUME_STEP Minimum step of volume change for concluding a deal

I.e., trades (and hence orders) with a volume of 0.1, 0.11, 0.12 ... are possible in our example. etc.

and impossible are 0.09, 0.08, 0.07 ... etc.

Exactly deals, nothing is said about the position volume.

Here is an example: we have buy 1.0 lot, we partially close it with sell 0.95 (this corresponds to the conditions of volume granulation), the remaining position is 0.05 lots. And we cannot close it now.

We should first increase the position to at least 1.05 (an order cannot be less than 0.1) and then close it completely.

It is absurd that we cannot completely close an open position.

Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
  • www.mql5.com
Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте - Документация по MQL5
 
sergey1294:
I just checked it manually and it closes perfectly. I opened buy position with 0.21 lot and closed sell position with 0.2 lot. 0.01 lot is left in the market though the minimum was 0.1 lot. I checked it on 4 as well. There are no errors in partial closing there as well.

Is the remaining position of 0.01 lot closed by an opposite trade of the same volume?

I.e. a sell trade with a volume of 0.01 goes through (of course, completely closing the open position)?

 
voix_kas:

Dear Sir, you read my question.

I am not asking if it is possible to make a trade with a volume that is less than the minimum set lot in a particular account/account type. Of course not.

My question is this: From the point of view of the MQL5 concept, is it acceptable to execute a trade with a partial lot less than minimal acceptable lot? (Of course, we are talking about ORDER_FILLING_CANCEL andORDER_FILLING_RETURN).

We are not talking about empirical conclusions, but about specific requirements/restrictions in MQL5 which have been officially published.

The answer is simple - not possible and not permissible, under all conditions (otherwise it's in SD at once. And not only "we" would be outraged as testers of the client part, but also the brokers who are testing the server part).

Answering the technical part of your question, I will answer that the check exists in the client part (terminal and tester), and without any doubts in the server part.

Checking of the client part is necessary firstly, to pre-find all sorts of violations of trading conditions and rules, and secondly, to reduce the load on the server and prevent "attacks" with incorrect requests (the terminal will not simply send a request to the server if it detects a violation of trading rules or a glaring error in the request).

In turn, the server (as the final authority) will also necessarily check the correctness of the trade request (including the correctness of the expected consequences of the execution of this request).

Reason: