Errors, bugs, questions - page 433

 

Renat, if you could please pay attention to application #124661 in the SR.

I have been waiting for an answer since 13 June.

 
voix_kas:

Renat, if you could please pay attention to application #124661 in the SR.

I have been waiting for an answer since 13 June.

So you have been given the right answer more than once. I have answered you again.

 
Renat:

So you have been given the right answer more than once. Answered you again.

I don't see the answer in this application. The last comment in it is mine from 2011.06.21 09:25 (a repeated reminder of the relevance of the question).

Duplicating it here just in case:

Do I understand correctly that the limit on the minimum volume/lot of a trade/order is only relevant for opening a position?
Do they apply to deals/orders resulting in closing, increasing, decreasing or reversing positions?
The minimum deal limit applies to all five (5) of the above scenarios.
It seems that all possible scenarios are described. Or are there any other scenarios besides these five (5)?

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

You have been answered twice, then I answered.

I will answer again - yes, full closures are not covered by the volume limit rule.

 
papaklass:
Are we talking about increasing the speed of MQL5?
Yes, code optimisation means exactly that.
 
Renat:

You were answered twice, then I answered.
I'll answer again - yes, full closes are not subject to the volume limit rule.

Renat, don't misunderstand me. I repeat my question not for the sake of pampering, but to clarify it.
So far your answer and that of your colleagues (in the SD) covers 2 (two) scenarios: 1) opening a position and 2) complete closing a position (probably with ORDER_FILLING_AON being mandatory).
The execution of an order (trade) canresult in at least three (3) other scenarios: increasing, decreasing or reversing a position.
Unfortunately, I cannot find any clear explanation of these three scenarios in the answers of MQ. :(

For clarity, here are some examples(in all cases on the server, minimum lot = 1.0; minimum step = 0.1):

Example #1 (position shortening).
We have a long position of 1.0. We are trying to completely close the position (using ORDER_FILLING_CANCEL). We send a Sell order of 1.0 lot. The order is partially executed (0.9 lots).
The result is that there is an open long position of 0.1 lot. Thus, we can conclude that the minimum lot volume requirement does not apply to the position shortening scenario.

Example 2 (reversal of position).
We have a long position of 0.1 lot. I send a Sell order to the server for the volume of 0.2 lots. Will the server accept this order? (The minimum lot requirements are not met again).

Example 3 (increase of position).
We have a long position of 0.1 lot. I send to the server a Buy order of 0.1 lot.

 
voix_kas:


To illustrate, here are some examples(in all cases the minimum lot = 1.0; minimum step = 0.1):

Example 1 (short position).
We have a long position of 1.0 lots. We are trying to completely close the position (using ORDER_FILLING_CANCEL). We send a Sell order in the volume of 1.0 lot. The order is partially executed (0.9 lots).
The result is that there is an open long position of 0.1 lot. Thus, we can conclude that the minimum lot volume requirement does not apply to the position shortening scenario.

If the position closes partially at 0.9 (with an order at 1.0), then we will have to send another order to close the balance at 0.1.

And if the order is executed through an external gateway, there is a high probability that they would only close the entire 1.0 lot volume at once, not allowing us to divide it.

Example 2 (reversal of position).

We have a long position of 0.1 lot. I send a Sell order to the server for the volume of 0.2 lots. Does the server accept this order? (The minimum lot requirements are not met again).

It is not a full liquidation of a position at zero, so the application will be rejected.


Example 3 (increasing position volume).
I have a long position of 0.1 lot. I send a buy order to the server for the volume of 0.1 lot. The server example of such an order?

Of course not.

Please read the rules literally and don't try to make up your own conditions. The rule is simple "the volume limit rule may not apply when a position is liquidated at ZERO". This rule has been voiced many times.


You should also take into account that any broker or any exchange gateway can use their own, more stringent volume control rules.

 
I see. Thanks for the clarification.
 
IlyaBukalov:

The maximum number of lines between which opening/closing brackets will be highlighted is 128. This limitation was introduced because it makes no sense to highlight opening and closing parentheses that do not fit into one screen. Besides, the performance of MetaEditor has considerably increased after this restriction was introduced.

It is very inconvenient when a parenthesis is not highlighted after 128 strings, you often have to scroll through two or three screens to find where the parenthesis is closed.
 
voix_kas:

Not a crucial question, but still. String concatenation. The documentation describes two functions StringAdd and StringConcatenate.

...

Result:

2011.06.26 19:10:55 test (EURUSD,H1)№1 2012 milliseconds, i = 10000000
2011.06.26 19:11:04 test (EURUSD,H1)#2 8269 milliseconds, i = 10000000
2011.06.26 19:11:10 test (EURUSD,H1)#3 6661 milliseconds, i = 10000000

It turns out, though, that normal addition is faster.

This example is incorrect.

In the first method it should be "result = result + string1 + string2 + string3;"

I'd also make different result for all 3 tests, otherwise they won't start in equal conditions (some memory is already allocated).

Even better - put tests into different scripts and run them sequentially.


I've got it like this:

1. length = 10`000

2011.06.27 02:43:07 sStingTest (EURUSD,M1) №1 2542 milliseconds, i = 10000
2011.06.27 02:43:05 sStingTest (EURUSD,M1) #2 0 milliseconds, i = 10000
2011.06.27 02:43:05 sStingTest (EURUSD,M1) #3 0 milliseconds, i = 10000


2. length = 100`000

2011.06.27 02:37:40 sStingTest (EURUSD,M1) #2 47 milliseconds, i = 1000000

2011.06.27 02:37:39 sStingTest (EURUSD,M1) #3 15 milliseconds, i = 1000000

Finish #1 - did not wait


3. length = 1`000`000

2011.06.27 02:37:40 sStingTest (EURUSD,M1) #2 780 milliseconds, i = 1000000

2011.06.27 02:37:39 sStingTest (EURUSD,M1) #3 187 milliseconds, i = 1000000

The end of # 1 did not take place.


4. length = 10`000`000

2011.06.27 02:48:14 sStingTest (EURUSD,M1) #3 1903 milliseconds, i = 10000000

MemoryException: 602492946 bytes not available" error started at second test.


Conclusion: StringConcatenate is the fastest.


By the way, the StringAdd function has also not very correct comparison example.

My code to test it is in trailer.

Files:
Reason: