Position closure of balanced deals

Created at 01 Dec 2014, 09:54
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
MA

maxim_7

Joined 14.07.2013

Position closure of balanced deals
01 Dec 2014, 09:54


Position closure of balanced deals.

Problem description:

  1. 2X open positions X Long + X Short
  2. Margin level ~40%
  3. During high volatility one most unprofitable position closed by server
    1. Let say one Long position
    2. New account state is: X-1 Long + X Short positions
  4. Prices moves Up – against me
  5. Server closes another Long position
    1. New account state is: X-2 Long + X Short positions
  6. And finally all position closed during very small price change.

Thus I think what this wrong algorithm to close positions.

Correct behavior of server should be at step 5) Close most unprofitable Short position.

This will move Margin level to new balanced state >> 40% and prevent waterfall of position closure.

Maxim


@maxim_7
Replies

AlexanderRC
02 Dec 2014, 12:56

In the latest release notes cServer behavior was changed to close the "position with the biggest Margin will be closed on Stop Out event instead of most losing position". Assuming that all of the positions in this example have the same volume, cServer should use some other sortable metric to determine which position to close.

Spotware, can you provide an insight, what metrics are used to choose the position if volumes (and the locked margin) are the same?


@AlexanderRC

Spotware
02 Dec 2014, 14:15

Assuming that all of the positions in this example have the same volume, cServer should use some other sortable metric to determine which position to close.

The most losing position will be closed in that case.


@Spotware

maxim_7
02 Dec 2014, 18:12

RE:

Spotware said:

The most losing position will be closed in that case.

Exactly, this is the problem. From my point of view, this behavior is wrong. and MUST be changed, to close opposite positoin to preserve account in balanced state (X Volumes Long and X Volumes Short), instead of closure one by one all positions of one direction.

 


@maxim_7

AlexanderRC
03 Dec 2014, 04:35

RE: RE:

maxim_7 said:

Spotware said:

The most losing position will be closed in that case.

Exactly, this is the problem. From my point of view, this behavior is wrong. and MUST be changed, to close opposite positoin to preserve account in balanced state (X Volumes Long and X Volumes Short), instead of closure one by one all positions of one direction.

 

As a workaround, a cBot can balance the Long/Short position count by immediately closing a position of the opposite direction. It should be pretty trivial to write one.


@AlexanderRC

maxim_7
04 Dec 2014, 09:11

RE: RE: RE:

AlexanderRC said:

As a workaround, a cBot can balance the Long/Short position count by immediately closing a position of the opposite direction. It should be pretty trivial to write one.

Except one thing: Server side will serve all cases cBot only specific client.


@maxim_7