Errors, bugs, questions - page 68

 
kirill190982:
Hello, advise me if I have understood correctly that CFD instruments have a restriction, namely the orders type is intraday excluding SL and TP. i.e. if i am correct, what function should be used to determine that i should not place SL, TP. Thank you

These are the settings for these characters on the server. This does not mean that stop levels cannot be set:

At the end of the trading day the pending orders will be deleted and the stop levels of open positions will be retained.

This setting cannot be checked from MQL5 at the moment.

 

ACCOUNT_LIMIT_VOLUME

Maximum allowed combined volume of open positions and pending orders (regardless of direction) per symbol

double


Thanks to the developers - thanks for the order limit, but in this case, I do not quite understand what it says and how it should be understood. :(

I am confused by the part concerning pending orders. Please explain why they have been added here?

As far as I understand, the wording should be something like this - "The maximum values of the total open positions.

That by itself implies that the pending orders before the moment of triggering should not pertain here in any way, and the control of this condition is conducted by the server (on the fact of triggering an order).

PS

Currently 0 is returned (I take it to mean the limit is not in effect), and 15.0 should be returned during the Championship. Am I right?

 
Interesting:

ACCOUNT_LIMIT_VOLUME

Maximum allowed combined volume of open positions and pending orders (regardless of direction) per symbol

double


Thanks to the developers - thanks for the order limit, but in this case, I do not quite understand what it says and how it should be understood. :(

I am confused by the part concerning pending orders. Please explain why they have been added here?

As far as I understand, the wording should be something like this - "The maximum value of open positions".

That by itself means that pending orders before the moment of their triggering should not be related in any way here, and the server performs the control (upon the triggering of an order).

See the Championship Rules:



The server will not perform an extended analysis - whether the triggering of a pending order will result in decreasing a position or increasing it. If we analyze each trade request for placing a pending order, it will be an unjustified load on the server.

Правила Automated Trading Championship 2010
  • championship.mql5.com
Правила Automated Trading Championship 2010
 
Rosh:

See Championship Rules:

The server will not perform an extended analysis - whether the triggering of a particular pending order will result in the reduction of a position or its increase. If we analyze each trade request for placing a pending order, it will be an unreasonable load on the server.

I thought it would not be too difficult for the server to calculate the aggregate position when the order triggers, but I must be wrong...

I would have to check the conditions on my own...

PS

Although, I would like to know - what will be the consequences, apart from disqualification, if this value is exceeded, and what error will the server return, if anything (well, a trader or a robot may make a mistake in calculations)?

 
Rosh:

See Championship Rules:



The server will not perform an extended analysis of whether the triggering of a pending order will result in the reduction of a position or its increase. If we analyse every trade request for placing a pending order, it will be an unjustified load on the server.

Does this mean that if you open a position of 15 lots, it cannot be closed until the sl/tp is triggered, or will the opening direction be taken into account?
 
Interesting:

I thought it would be easy for the server to calculate the aggregate position when an order triggers, but I was wrong...

We need to calculate one step further - let's say we leave the check for the moment of triggering. The pending order triggers and suddenly we find out that the maximum volume is exceeded. On what grounds will be the order rejected? It is better to eliminate all unnecessary questions from the beginning.
 
Swan:
Does this mean that if you open a position of 15 lots, it cannot be closed until the sl/tp is triggered, or will the opening direction be taken into account?
It can be closed with three consecutive market orders of 5 lots each. But this is a question for another thread, it has already been discussed there - Automated Trading Championship 2010.
 
Swan:
Does it mean that if you open a position of 15 lots, it cannot be closed until sl/tp are triggered, or will the direction be taken into account when opening it?

SL and TP are not supposed to be involved. And since it is built in any case should be considered as either SL or TP. I suppose it would be possible to close it, otherwise all the algorithms where SL and TP are not explicitly written may cause an error that occurs when conflicting with this restriction.

PS

That is why I suggested making the limitation for open positions only.

 
Rosh:
It can be closed with three consecutive market orders of 5 lots each. But this is a question for another thread, it has already been discussed there - Automated Trading Championship 2010.
Yes, before the innovations. but you can understand from the help that the direction of any orders is not taken into account)
 
Rosh:
We should calculate one step further, let's say we leave the check for the triggering moment. The pending order has triggered and suddenly we find out that the maximum volume has been exceeded. On what grounds will be the order rejected? It would be better to cut off all unnecessary questions right away.

I have assumed approximately the following algorithm - Price reaches the order, there comes the moment of triggering, but before the order is transferred to the market it is checked for Correctness according to this rule. If the operation contradicts this rule, we have two choices:

1. - - delete the order and send the client an error code (if the order should trigger according to the "all or nothing" rule);

2. - perform the transaction for the admissible volume (if the "all or nothing" condition is not applicable), and delete the remaining volume like in the first case, as an order placed by the server (with the error code indicated).

PS

Otherwise I do not understand how to handle the situation in which the limit is reached, but the operation is carried out not explicitly specified SL and TP.

Suppose we have 3 positions of 5 lots each and close one of the positions with an opposite order of 5 lots. As a result, we obtain an overshoot.

The rule will not be violated, as I understand it, if the Volume<=14 lots is opened and one of the positions is partially (or fully) closed.

Документация по MQL5: Стандартные константы, перечисления и структуры / Коды ошибок и предупреждений
Документация по MQL5: Стандартные константы, перечисления и структуры / Коды ошибок и предупреждений
  • www.mql5.com
Стандартные константы, перечисления и структуры / Коды ошибок и предупреждений - Документация по MQL5
Reason: