Added Trailing Stop for Binance Futures USDS-M and COIN-M bots


Content:

  1. What is a Trailing Stop and what is it for?
  2. How is the price change tracked after the trailing stop mechanism is activated?
  3. How do I enable Trailing Stop in a bot?
  4. Recommendations for setting up a Trailing stop mechanism.

1. What is a Trailing Stop and what is it for?

Trailing stop (another name is trailing tail profit) is used to maximize income. It’s a substitute for the classic limited take profit order. The essence of the mechanism is that it is possible not to issue a take profit warrant immediately after opening a position, but to wait for the best price and get more income by tracking the price change. When placing a trailing stop order, the concept of a stop price appears, this is the price when the position is closed. The stop price is initially separated from the trailing stop activation price by a specified percentage of deviation and will change in the direction of increasing revenue following the current price on the exchange. As a result of the operation of the trailing stop mechanism, the position will be closed by a market order, when the price will be the most advantageous for the whole time of the tracking, and then turned in the opposite direction by the percentage of deviation. 

How does this work? Trailing stop mechanism has two settings:

– Activation price (configuring the bot “Profit %”). This will be the price at which the trailing stop mechanism will be activated, the first stop price will be determined and tracking of further price changes will begin.

– Percentage of deviation (configuring the bot “Percentage of deviation”). Sets the lift of the stop price. When the current price on the exchange continues to go in the direction of increasing the profit, then the price stop also changes, following the current price by a percentage of the deviation. But this process is not infinite, and when the current price on the exchange unfolds and goes down in the direction of lowering the profit margin, at some point the price of the stop will become equal, at that moment the order on the market will work and the position will close. 

Thus, if after the bot opening the price goes in the direction of the profits then when the activation price is reached, the bot on the exchange will place the order trailing_stop_market. The function of this order is then fully transferred to the control of the Binance Exchange. The Exchange begins to monitor price changes.

For the LONG algorithm – when the maximum price is reached and the price is then reversed on the set percentage of rejection, the exchange will send a market order for the sale, the position will be closed.

For the SHORT algorithm – if the minimum price is reached and the price is then reversed on the set percentage of rejection, the exchange will send a purchase order, the position will be closed.

Once such order is activated on the market, the bot will calculate profit at the average price of the order operation and complete the current cycle of work.

2. Let’s look at an example and with numbers how the trailing stop mechanism works

Let’s take a look at how Trailing Stop works with the example of the BTC/USD trade pair. Suppose we opened the LONG position, bought the 1BTC at the price of 10000USD. When the position was opened, the trailing order was placed with the activation price 5%, the percentage of deviation 1%. The following table shows how trailing stop will work.

Price of BTC Stop Price Trailing stop state Comment
$10300 not specified Trailing stop is not active the price rose but did not reach 5% to activate the trailing stop mechanism
$10500 $10395 Trailing stop is active the price reached 5%, mechanism activated, price of stop. 10500-1%=10395
$10400 $10395 Trailing stop is active The price decreased but did not reach the stop price to complete the tracking mechanism with orders on the market. The price of the stop does not change.
$10500 $10395 Trailing stop is active The price increased but did not update maximum, so the stop price also does not change.
$10600 $10494 Trailing stop is active The price has increased and has updated at most since the start of the tracking, the price of the stop is pulled up behind. 10600-1%=10494
$10800 $10692 Trailing stop is active The price has increased and has again updated the maximum since the start of the tracking, the stop price is pulled up again. 10800-1%=10692
$10700 $10692 Trailing stop is active The price decreased but did not reach the stop price to complete the tracking mechanism with an order on the market. The price of the stop does not change.
$11000 $10890 Trailing stop is active The price has increased and has again updated the maximum since the start of the tracking, the price of the stop is pulled up again. 11000-1%=10890
$10900 $10890 Trailing stop is active The price decreased but did not reach the stop price to complete the tracking mechanism with an order on the market. The price of the stop does not change.
$10600 $10890 Stop loss triggered the price has been further reduced and the price of the stop is lower, a market order is triggered and the position is closed at an average price of approximately $10700

 

The example in the table shows a possible price change on the exchange where the position closed at a price of $10,700, which is a profit of 7% and it is higher than if we just used a limit take profit order with a target profit of 3%.

3. How do I enable Trailing Stop in the bot?

Enable trailing stop functionality to create/edit bot:

  1. In the basic settings set the desired percentage of profit «Profit (%)», which will be the price of activation of trailing foot.
  2. Activate the “Trailing Stop” checkbox.
  3. Set the “Deviation percentage”.

4. Recommendations for setting up the Trailing stop mechanism.

Trailing stop can increase revenue when the price has gone to the side of profit and continues this movement, but you need to understand that using this mechanism you can miss the only opportunity to get a profit in the current cycle of the bot, since the current price after reaching the activation price of the trailing stop can go in the opposite direction, resulting in a loss, although using the usual limit take profit, the order we could get a profit here.

If you have decided to use a trailing stop mechanism, we recommend to set the price of the activation mechanism «Profit (%)» a little more than used for the usual limit take profit order.

Choose the percentage of deviation to be in profit when executing a trailing stop, if the current price on the exchange after reaching the activation price changes in the direction of loss.

2,121 views
5 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments