Close / Reverse

última actualización 21/05/2023

In a LONG position, the position is closed when a sell↓ signal is received, for example:

{
  "name": "Hook 196",
  "secret": "2ehiexig0r5",
  "side": "sell",
  "symbol": "{{ticker}}"
}

In a SHORT position, the position is closed when a buy↑ signal is received, for example:

{
  "name": "Hook 196",
  "secret": "2ehiexig0r5",
  "side": "buy",
  "symbol": "{{ticker}}"
}

The position will also be closed if TradingView strategy sends "positionSide": "flat" instead of long or short.

1. Enabled

If enabled, upon receiving a closing signal, an order will be created to close the position.

When the left checkbox is selected, the value is sourced from TradingView signal, not the terminal settings. Details ->

2. Order type

3.1 Partial position closing

Select "Close/reverse by amount in signal".

By using the drop-down menu, you can select the method for calculating the closing quantity in the order.

  • Open Amount + Position Amount

    Used for position reversal.

  • Amount Specify the token quantity (contracts) for the created order in the right-hand field. For example, if you enter 100 for XRPUSDT, an order for 100 XRP will be placed.

  • Volume Order quantity (volume) is specified. For example, entering 0.01 for LTCBTC pair will place an order with a volume of 0.01 BTC.

  • Volume, USD Order quantity (volume) is specified in dollars. For example, if 100 is specified for the LTCBTC pair, an order with a volume equivalent to $100 will be created.

  • Full balance % Orders are created based on a percentage of the total balance.(wallet balance + position volume + position PnL). For example, with 1000 USDT in the wallet, 2000 USDT in positions, a PnL of 100 USDT, and a specified 10% balance, the order will be created for (1000 + 2000 + 100) x 10 / 100 = 310 USDT.

The full balance includes all tokens in your account. For instance, if your wallet holds 100 BUSD and 100 USDT, the total balance would be 200.

  • Full Balance% х Leverage Just like in the previous example, but the obtained amount is multiplied by the leverage. From the example above, with a leverage of 5x the order amount would be 1550 USDT.

  • Free Balance, % Orders are created based on a percentage of the available balance in the specified market. For example, with 500 USDT in your wallet, 100 USDT in positions, and a 10% balance specification, the order will be created for an amount of (500 - 100) x 10 / 100 = 40 USDT.

  • Free Balance % х Leverage Just like in the previous example, but the obtained amount is multiplied by the leverage. For example, using the data from the previous item and a 7x leverage, the order amount will be 40*7= 280 USDT.

  • Position volume, % A value between 0 and 100 is specified. For instance, if you specify 50, it will partially close the position by half. If you specify 100, it will completely close the position.

  • Position volume + balance % Used for position reversal.

  • Position volume + (balance % x leverage) Used for position reversal.

3.2. Total position closing

Select "Close position completely".

3.3. Position reversal

This option is only available for the Futures Market in one-way mode (non-hedging).

When enabled, upon receiving a closing signal, a reverse position will be created for either the signal quantity or the current position quantity.

When enabling position reversal, it is important to deactivate the hedge mode on the exchange and activate the one-way mode.

By signal amount

When selecting this option, you can configure the amount for position reversal:

  1. Open amount + Position amount For example, if there is $100 remaining in a position after a partial close, and the opening amount specified in the signal is $500, when the close signal is received, a $600 order will be created. This order will close the current position and open a new position of $500 in the opposite direction.

  2. Amount A reverse order will be created for the specified number of tokens (contracts). For example, if the LONG position in the XRPUSDT pair specifies 100, it means that when a SELL signal is received, an order for 100 XRP will be created to close the position.

  3. Volume A reversal order will be created for the specified amount. For example, if you have a LONG position in the LTCBTC pair and you specify 0.01, a SELL signal will trigger an order to sell 0.01 BTC.

  4. Volume, USD A reversal order will be created for the specified dollar amount. For example, if you specify 100 in the LTCBTC pair, an order will be created with a volume equivalent to $100.

  5. Balance, % A closing order will be created based on a percentage of the total balance, which includes (wallet balance + position volume + and position PnL).

    For example, with 1000 USDT in the wallet, 2000 USDT in positions, a PnL of 100 USDT, and a specified 10% balance, the order will be created for (1000 + 2000 + 100) x 10 / 100 = 310 USDT.

  6. Balance % x Leverage Just like in the previous example, but the obtained amount is multiplied by the leverage. From the example above, with a leverage of 5x the order amount would be 1550 USDT.

  7. Position amount, % When a signal is received, the position is closed based on the specified percentage.

  8. Position amount + balance % When a signal is received, the current position will be closed, and a new position will be opened based on a percentage of the balance.

  9. Position amount + (balance % x Leverage) When a signal is received, the current position will be closed, and a new position will be opened based on a percentage of the balance multiplied by the leverage.

By position amount

When a signal is received, a reversal order will be created, which is equivalent to doubling the current position. This results in closing the current position and opening a new one with the same quantity.

Limits

Check profit

If enabled, unprofitable positions will remain open when the close signal is received.

Bulk operations

Close ALL positions

If this parameter is enabled and a closing signal is received, all open positions in this market will be closed based on the Limit/Position settings:

  • Both Will close all positions on this market.

  • Only Long Will close all Long positions on this market.

  • Only Short Will close all Short positions on this market.

If a signal is sent with "positionSide": "flat", then all positions on that pair in that market will be closed. For example:

{
  "name": "Hook 72767",
  "secret": "dy2uuc5bih8",
  "side": "buy",
  "symbol": "XRPUSDT",
  "positionSide": "flat"
}

Controlling options in the signal

Do you have any questions? We can help you in our Telegram chat room.

Last updated