Custom symbols. Errors, bugs, questions, suggestions. - page 15

 
Roman:
Well what's not clear here, in the post with bug #20 I specified the ID setting, and indicated the reason for not matching.
SYMBOL_TRADE_EXEMODE
SYMBOL_TRADE_CALC_MODE
These are completely different modes, and do not apply to the problem.

That should make it clearer.

And if you want to use another identifier from ENUMSYMBOL_FILLING_XXX
There is no identifierforSYMBOL_FILLING_RETURN!

That's right - there isn't. They are not identifiers - they are flags. Because SYMBOL_FILLING_RETURN always exists. And the other two flags can either be both or one of them:

When sending an order you can specify a policy to fill the volume declared in the trade order. The allowable variants of order execution by volume for each symbol are shown in the table below. Not just one mode can be set for each symbol, but several modes through a combination of flags. The combination of flags is expressed as the logical OR (|) operation , for example SYMBOL_FILLING_FOK|SYMBOL_FILLING_IOC. To check whether a particular mode is allowed for an instrument, the result of the logical AND (&) must be compared with the mode flag.

Filling policy

Identifier

Value

Description

All/None

SYMBOL_FILLING_FOK

1

This execution policy means that the order can only be filled to the specified volume. If there is not enough volume of the financial instrument available in the market at the moment, the order will not be executed. The required volume can be compiled from several offers currently available in the market.

All/Partial

ALL_FILLING_IOC

2

In this case the trader agrees to perform a deal with the maximum volume available in the market within the volume specified in the order. If full execution is not possible the order will be executed for the available volume, and the unexecuted volume of the order will be canceled. Possibility of use IOC orders is defined on a trading server.

Return

There is no IOC

This mode is used for market (Buy and Sell), limit and stop-limit orders and only in the "Market Execution" and "Exchange Execution" modes. In case of partial execution a market or limit order with a residual volume is not removed but remains in force.



  • If SYMBOL_FILLING_FOK is present , but SYMBOL_FILLING_IOC is not , SYMBOL_FILLING_MODE will return 1. At the same time there is a "Return".
  • If SYMBOL_FILLING_IOC flag is presentbut not SYMBOL_FILLING_FOKflag , SYMBOL_FILLING_MODE will return 2. In this case there is a "Return".
  • If there is a SYMBOL_FILLING_FOK flag and there is a SYMBOL_FILLING_IOC flag , then SYMBOL_FILLING_MODE will return 3. At the same time there is a "Return".
Hence the conclusion: "Return" is always there, and the other two modes are determined by the presence of flags.
 
Artyom Trishkin:

Right - no. They are not identifiers - they are flags. Because SYMBOL_FILLING_RETURN is always there. And the other two flags - can either be both or one:

But this is not explicit behaviour, which is misleading.
And the documentation does not say that SYMBOL_FILLING_RETURN is always present.
Why not set it explicitly? SYMBOL_FILLING_RETURN

Please show me an example of how to set the flag for exchange filling correctly then

CustomSymbolSetInteger(SName, SYMBOL_FILLING_MODE, SYMBOL_FILLING_RETURN);

I'm getting confused with these non-explicit flags.

 
Roman:

But it's not explicit behaviour which is misleading.
And the documentation doesn't say that SYMBOL_FILLING_RETURN is always there.
Why not set it explicitly? SYMBOL_FILLING_RETURN

Please show me an example of how to set the flag for exchange filling correctly then

Because I'm confused by these non-explicit flags.

Zero - if no other flags are needed.

 
Roman:

But it's not explicit behaviour which is misleading.
And the documentation doesn't say about the sign that SYMBOL_FILLING_RETURN is always there.

Why not set it explicitly? SYMBOL_FILLING_RETURN

Please show me an example of how to set the flag for exchange filling correctly then

Because I'm confused by these non-explicit flags.

Here is from the documentation:

"In execution modes "By Market" and "Exchange" the fill policy "Return" is always allowed for all order types. The permissibility of the other types is checked using the SYMBOL_FILLING_FOK and SYMBOL_FILLING_IOC properties. "

 
Artyom Trishkin:

Zero - if no other flags are required.

Set zero, sets None.
None is not an exchange fill-in.
If I try it this way

CustomSymbolSetInteger(SName, SYMBOL_FILLING_MODE, SYMBOL_FILLING_FOK & SYMBOL_FILLING_IOC);

SYMBOL_FILLING_FOK & SYMBOL_FILLING_IOC also returns None, not 3 as you said above.

How do I set the exchange fill correctly after all?

CustomSymbolSetInteger(SName, SYMBOL_FILLING_MODE, SYMBOL_FILLING_RETURN);
 

And then there's this.

CustomSymbolSetInteger(SName, SYMBOL_FILLING_MODE, 3);

Sets All, which is the same as All allowed.

And in the documentation, in the "Value" column, there is nothing, empty!
And in the "Identifier" column for the "Return" line, I still suggest specifying the correct combination for the flags!
Why not just addSYMBOL_FILLING_RETURN with value 3, clearly and understandable to everyone.

 
Roman:

Filling flags on custom ones for what practical purpose?

 
Roman:

Set zero, sets None.
None is not an exchange fill-in.
If I try it this way

SYMBOL_FILLING_FOK & SYMBOL_FILLING_IOC also returns None, not 3 as you said above.

How do I set the exchange fill correctly after all?

CustomSymbolSetInteger(SName, SYMBOL_FILLING_MODE, SYMBOL_FILLING_FOK | SYMBOL_FILLING_IOC);
 
Artyom Trishkin:

There, that combination establishes All. Thank you.
But agree this combination does not look obvious.
We don't use a logical "Not" when setting properties

If notSYMBOL_FILLING_FOK or notSYMBOL_FILLING_IOC
then the hidden
SYMBOL_FILLING_RETURN -"Always there" isused

In your combination, we instead say explicitly, set FOK or IOC.
In the exchange filling there is no FOC or IOC therefore it is misleading.

Therefore it's logical, this combination should be added to documentation, in column"Identifier" and its value 3
Or better to add
SYMBOL_FILLING_RETURN

Then Bug #20 is excluded from bugs.
But have in mind that the explicitness feature is violated.

 
fxsaber:

Filling flags on custom ones for what practical purpose?

To display the tool specification correctly.
It is also possible that these modes are used somewhere in the depths of the terminal.
In the tester or elsewhere, so I am used to filling everything in explicitly.

Reason: