Reversal trading

Reversal trading (RT) is a Gunbot technique to keep on trading profitably when prices move downwards after an asset has been purchased.

The principle is to use the already invested amount of base currency to accumulate more units of the quote currency after prices have moved downwards. When prices keep going down, or go sideways at a lower level than the initial purchase, RT can keep accumulating until prices move up enough to sell the accumulated amount for an overall profit.

Trading fees paid while in reversal trading are all accounted for.

reversal-trading-simplified

Note that this example is kept simple intentionally. Prices don’t have to go straight down for RT to succesfully accumulate.

How it works

Reversal trading starts when the current price is a set percentage lower than the last bought price, this is defined with RT_GAIN. The initial bag gets sold for base currency (RT_SELL) and the invested amount is reserved for buying back more units when prices drop further. When the price then drops by a percentage defined with RT_BUY_LEVEL, quote currency gets bought (RT_BUY). You now own more quote currency than you initially bought, at a lower price per unit.

This process will repeat when prices keep dropping, enabling you to keep accumulating quote currency without investing additional assets. Required funds are locked for the pair in reversal trading, and can’t be used by other pairs.

With TM_RT_SELL, or when using bb as selling strategy, it’s possible to place an RT_SELL at a higher rate than the previous RT_BUY, enabling you to reach a profitable exit point much faster.

When prices reach an overall profitable price (EXIT POINT), a normal sell order is placed.

In case prices recover to the break even point before an RT_BUY could be made, the initial bag will be bought back to continue normal trading (RT_BUYBACK).

The exact process for reversal trading is dependant on the strategies used for buying or selling. There are slight differences described in detail below.

Warnings:

  • Do not activate reversal trading on existing bags that are already down a lot unless you use TM_RT_SELL! The decision to run reversal trading or not should best be made before you start trading a pair, this way the process can kick in timely.
  • Reversal trading math is done based on your trading history, if your last sell order was at loss (and not caused by stop limit), reversal trading would immediately start when you enable it. To prevent unwanted reversal trading, make sure to either have a profitable last sell order or to have set IGNORE_TRADES_BEFORE at a time after your last sell order at loss. Alternatively, you can set a maximum price difference between current price and average bought price with RT_MAXBAG_PROTECTION, to prevent RT from starting on pairs that already lost a lot of value.

RT flowcharts

There are three different ways Gunbot handles reversal trading, based on main strategies used for a pair. The chosen buy strategy affects the way RT_BUY orders are executed, the sell strategy affects RT_SELL orders.

Optional steps in the flowcharts are only relevant when TM_RT_SELL and/or RT_TREND_ENABLED are enabled.

1. RT process for all strategies except bbBBTA and stepgain

reversal-trading-gain

2. RT process for bb and BBTA

reversal-trading-bb

When using BBTA the same logic applies to reversal trading: act on reentry instead of crossing LOW_BB/HIGH_BB

LOW_BB/HIGH_BB in reversal trading use the same settings as with regular trading on bb.

3. RT process for stepgain

reversal-trading-stepgain

Relevant settings

Following settings options are available for reversal trading.

Reversal trading is available in most Gunbot strategies, on each strategy page you’ll find an overview with only the relevant settings for that strategy.

Parameter Default value Description
RT_ENABLED false Values: true or false.
When set to true and prices drop, reversal trading will try to use the assets originally invested in your bag to accumulate more units, which can be sold for profit earlier than the original bag. When double up is enabled, RT will start when DU_CAP_COUNT is reached.
RT_GAIN 1.5 Values: numerical – represents a percentage.
Defines the percentage drop after initial buy or RT_BUY to trigger an RT_SELL. Make sure to set this higher then the spread between bid and ask to prevent unwanted buybacks.

When set to 2 and the last buy had a price of 100, an RT_SELL occurs when price is 98 or lower. Reversal trading will then wait for prices to drop by RT_BUY_LEVEL and buy more units back.

When prices move upwards instead of downwards it can happen that the bag gets bought back at the break-even price.

RT_BUY_LEVEL 2 Values: numerical – represents a percentage.
This defines the percentage the price has to drop after RT_SELL to trigger RT_BUY.

When set to 2 and the last RT_SELL happened at a price of 100, an RT_BUY occurs when price is 98 or lower. Reversal trading will then wait to sell for profit, or for another RT_SELL when prices keep dropping.

RT_SELL_UP 0.3 Values: numerical – represents a percentage above the last buy price.
This sets the starting point for trailing up an RT_SELL. Only works when TM_RT_SELL is enabled.

When you set this to 1 and price increases 1% after an RT_BUY, sell trailing gets activated to place the next RT_SELL as high as possible. The sell range is configurable with TRAIL_ME_RT_SELL_RANGE.

Optionally, you can use RT_TREND_ENABLED to only proceed with RT_SELL_UP when forecast trend indicates a strong uptrend.

RT_TREND_ENABLED false Values: true or false.
Enables the use of trend forecast for placing RT_BUY or RT_SELL orders when using TM_RT_SELL and/or TRAIL_ME_RT.

The forecast trend indicator combines smacross, xtrend and the time series forecast to provide an indication of the strength of a trend. This can be used to only place RT_BUY or RT_SELL orders when there is respectively a strong down- or uptrend.

An RT_SELL order will be placed when trailing crosses up trailing stop and forecast trend shows 6 green arrows. An RT_BUY order will be placed when trailing crosses down trailing stop and forecast trend shows 6 red arrows.

RT_ONCE false Values: true or false
Set this to true to only allow one full RT cycle (until final profit sell), after that the pair is set to not cycle again.

At the end of the RT cycle, the pair enabled setting will be set to false.

RT_ONCE_AND_CONTINUE false Values: true or false
Set this to true to only allow one full RT cycle (until final profit sell), after that RT will be disabled to continue normal trading.

At the end of the RT cycle, the RT_ENABLED setting will be set to false for the pair.

RT_BUYLVL 1 Values: 1 / 2 / 3 – represents steps.
This sets which step should be considered for RT_BUY orders:

1: Buy when price drops below RT_BUYLVL1 and the trend reverses or price hits RT_BUYLVL2. 2: Buy when price drops below RT_BUYLVL2 and the trend reverses or price hits RT_BUYLVL3. 3: Buy when price drops below RT_BUYLVL3 and the trend reverses.

RT_BUYLVL1 0.6 Values: numerical – represents a percentage.
Defines the first level below the last bought price to be considered for buying. Only used when RT_BUYLVL is set to 1.

When set to 1, this means that the price needs to be at least 1 percent below the last bought price.

RT_BUYLVL2 2 Values: numerical – represents a percentage.
Defines the second level below the last bought price to be considered for buying. Used when RT_BUYLVL is set to 1 or 2.

When set to 2, this means that the price needs to be at least 2 percent below the last bought price.

RT_BUYLVL3 70 Values: numerical – represents a percentage.
Defines the third level below the last bought price to be considered for buying. Used when RT_BUYLVL is set to 2 or 3.

When set to 10, this means that the price needs to be at least 10 percent below the last bought price.

RT_SELLLVL 1 Values: 1 / 2 / 3- represents steps.
This sets which step should be considered for RT_SELL orders:

1: Sell when price drops below RT_SELLLVL1 and the trend reverses or price hits RT_SELLLVL2. 2: Sell when price drops below RT_SELLLVL2 and the trend reverses or price hits RT_SELLLVL3. 3: Sell when price drops below RT_SELLLVL3 and the trend reverses.

RT_SELLLVL1 0.6 Values: numerical – represents a percentage.
Defines the first level below the last sell price to be considered for buying. Only used when RT_SELLLVL is set to 1.

When set to 1, this means that the price needs to be at least 1 percent below the last sell price.

RT_SELLLVL2 2 Values: numerical – represents a percentage.
Defines the second level below the last sell price to be considered for buying. Used when RT_SELLLVL is set to 1 or 2.

When set to 2, this means that the price needs to be at least 2 percent below the last sell price.

RT_SELLLVL3 70 Values: numerical – represents a percentage.
Defines the third level below the last sell price to be considered for buying. Used when RT_SELLLVL is set to 2 or 3.

When set to 10, this means that the price needs to be at least 10 percent below the last sell price.

RT_MAXBAG_PROTECTION 10 Values: numerical – represents a percentage.
Sets the maximum difference between the average bought price and current price for starting RT. When the difference is bigger, RT orders won’t be placed. This is used as a protection against starting reversal trading on bags that already dropped too much for the process to work effectively.

Reversal trading depends on several TrailMe settings to reach better entry points for RT_BUY and to make RT_SELL_UP work. The relevant settings are listed below.

Parameter Default value Description
TRAIL_ME_RT false Values: true or false.
Use this to enable tssl-style trailing for RT_BUY orders.
TM_RT_SELL false Values: true or false.
Use this to enable tssl-style trailing for RT_SELL orders above the last RT_BUY rate.
TRAIL_ME_BUY_RANGE 0.5 Values: numerical – represent a percentage.
This sets the buy range for TrailMe. Setting a range of 0.5% at a starting price of 0.1 would set a range between 0.0995 and 0.1005. As long as prices keep moving downwards, the range moves down along with the price. As soon as prices start going upward, the range freezes and a buy order is placed when the price crosses the upper boundary of the range.
TRAIL_ME_RT_SELL_RANGE 0.5 Values: numerical – represent a percentage.
This sets the sell range for TrailMe. Setting a range of 0.5% at a current price of 0.1 would set a range between 0.0995 and 0.1005. As long as prices keep moving upwards, the range moves up along with the price. As soon as prices start going downward, the range freezes and a sell order is placed when the prices crosses the lower boundary of the range.

Sign up for our newsletter: