Reversal trading

boekenbox edited this page Nov 15, 2018 · 10 revisions

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.

Contents:

  1. How it works
  2. RT flowcharts
  3. Relevant settings

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 using the sell criteria of your strategy.

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). Alternatively, you can set a custom level for buying back quote with RT_BUY_UP_LEVEL.

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. Simplified flow for RT

This flowchart shows the basic steps for reversal trading, not considering additional options like trailing or strategy specific conditions.

rt-flowchart-basic-v11 Bigger image

2. RT process for all strategies except bb

rt-flowchart-gain-v11 Bigger image

3. RT process for bb

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

rt-flowchart-bb-v11 Bigger image

Relevant settings

Following settings options are available for reversal trading.

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_BUY_UP_LEVEL
0 Values: numerical - represents a percentage above the last sell price.


This sets the price to place an RT_BUY order above the last RT_SELL order, the price must be below the break-even point for this to work. The default value of 0 disables this feature.

When you set this to 3 and price increases 3% after an RT_SELL, an RT_BUY order will be placed there instead of waiting for the price to hit the buyback point. Beware that will have a negative effect on the amount of quote units accumulated during RT, it functions as a kind of stop loss for reversal trading.

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 the trailing stop hits and forecast trend shows 6 green arrows. An RT_BUY order will be placed when the trailing stop hits 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_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.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.