Skip to main content

Reversal Trading (RT)

Info

Reversal Trading (RT) is an automated Gunbot strategy feature that attempts to manage a position when the price of an asset declines after an initial purchase. It does this by selling the asset and then using the proceeds to systematically rebuy increasing amounts of the same asset at lower prices, aiming for an overall profitable exit when the price eventually rises.

Reversal Trading (RT) is a Gunbot feature designed to continue trading and potentially recover or profit when prices move downwards after an asset has been purchased.

The core principle is to use the initially invested base currency to accumulate more units of the quote currency as its price declines. If prices continue to fall or move sideways at a level lower than the initial purchase, RT can continue accumulating more quote currency. This process aims to lower the average buy price, so that a subsequent price increase allows selling the total accumulated amount for an overall profit.

Trading fees incurred during Reversal Trading are accounted for in its calculations.

Reversal trading strategy showing accumulation process during downward price movement

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

danger

Using reversal trading can be challenging to set up and comprehend. It's advisable only to employ it if you have a definite plan and are prepared to dedicate a considerable amount of time to learn about it and assess your outcomes.

How It Works​

Reversal Trading begins when the current price falls a set percentage (defined by RT_GAIN) below the last purchase price. At this point, the initial 'bag' (the amount of quote currency held) is sold for base currency (this is an RT_SELL action), and the resulting base currency is reserved to buy back more units if the price drops further. If the price then drops by a percentage specified in RT_BUY_LEVEL, the reserved base currency is used to buy quote currency (an RT_BUY action). This results in owning more units of the quote currency than initially held, at a lower average price per unit.

This accumulation process can repeat if prices continue to drop, allowing for further accumulation of the quote currency without investing additional base currency beyond the initial amount. The base currency amount involved in an active Reversal Trading cycle for a pair is locked and cannot be used for other trading pairs.

Using TM_RT_SELL (Trailing Stop/Take Profit for RT Sell) or when the bb (Bollinger Bands) strategy is the primary sell method, it's possible for an RT_SELL to occur at a higher rate than the preceding RT_BUY. This can help reach a profitable exit point more quickly.

Once the price reaches a point where selling the total accumulated quote currency results in an overall profit (the EXIT POINT), a standard sell order is placed according to your strategy's main sell settings.

If the price recovers to the break-even point of the initial purchase before any RT_BUY accumulation occurs, the original amount of quote currency will be bought back (an RT_BUYBACK action) to resume normal trading. Alternatively, RT_BUY_UP_LEVEL allows you to define a custom price level above the last RT_SELL for this buyback to occur.

Tips Before Using​

  • Avoid activating Reversal Trading on existing bags that are already significantly down in price, unless you are also using TM_RT_SELL. Ideally, decide whether to use RT for a pair before starting to trade it, allowing the process to engage at the intended price points.
  • Reversal Trading calculations rely on your trading history. If your last sell order for a pair was at a loss (and not due to a stop-limit), RT might start immediately upon enablement and will continue until the cycle concludes profitably, even if you disable RT in the settings afterward.
  • To prevent unintended RT activation, ensure your last sell order for the pair was profitable, or set IGNORE_TRADES_BEFORE to a timestamp after any loss-making sell. You can generate a suitable Unix timestamp (in milliseconds) using a site like currentmillis.com. For certainty, also consider deleting the pair's state JSON file after setting IGNORE_TRADES_BEFORE.
  • Use RT_MAXBAG_PROTECTION to set a maximum percentage difference between the current price and the average purchase price. This prevents RT from starting on pairs that have already lost substantial value beyond this threshold.

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.

Simplified Flow for RT​

Reversal trading RT_SELL order placement visualization

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

RT Process for All Strategies Except bb​

Reversal trading RT_BUY order placement visualization

RT Process for bb​

Reversal trading exit point and profit taking visualization

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

RT Settings​

LabelConfig ParameterDefault ValueDetailed Description
RT enabledRT_ENABLEDfalseEnables the Reversal Trading (RT) feature. When active, RT allows strategies to attempt to capitalize on market reversals. Caution: Disabling RT while an RT cycle is active may necessitate manual adjustments to trade tracking data.
RT buy levelRT_BUY_LEVEL2Defines the percentage price drop required from the last RT_SELL price (or initial buy price if it's the first RT step) to trigger an RT_BUY. This aims to re-enter at a lower price to improve the average cost.
RT gainRT_GAIN1.5Sets the initial percentage drop from the last regular buy price that triggers the first RT_SELL action (selling the bag to start accumulation). It's also used to calculate subsequent RT_SELL levels from RT_BUY levels if not using TM_RT_SELL.
RT buy up levelRT_BUY_UP_LEVEL0Defines a percentage above the last RT_SELL price at which an RT_BUYBACK order is placed if the price recovers before an RT_BUY occurs. Setting to 0 disables this specific buyback trigger (though buyback at break-even still applies).
RT onceRT_ONCEfalseIf true, the trading pair will be automatically disabled after an RT cycle completes profitably, preventing further trades on that pair.
RT once and continueRT_ONCE_AND_CONTINUEfalseIf true, after an RT cycle ends profitably, Reversal Trading is disabled for the pair, but regular strategy trading continues. This effectively resets RT for future engagement if conditions are met again.
RT max bag protectionRT_MAXBAG_PROTECTION10Prevents RT from starting if the current price is below the average purchase price by more than this specified percentage. This acts as a safeguard against initiating RT on bags that are already significantly down.
RT trend enabledRT_TREND_ENABLEDfalseIf enabled, incorporates trend analysis (e.g., using TREND_EMA settings) to potentially delay RT_BUY or RT_SELL orders until the trend is perceived as more favorable.

Overview of Effects on Different Order Types​

Config ParameterAffected Order TypesNot Affected Order Types
RT EnabledRT buy, RT buyback, RT sellStrategy buy, Strategy sell, Close, DCA buy, Stop limit
RT GainRT sellStrategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy
RT Buy LevelRT buyStrategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT sell
RT Sell UpRT sellStrategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy
RT Buy Up LevelRT buybackStrategy buy, Strategy sell, Close, DCA buy, Stop limit, RT sell, RT buy
RT Trend EnabledRT buy, RT sellStrategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback
RT OnceRT cycle (until final strategy sell)Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy, RT sell
RT Once And ContinueRT cycle (until final strategy sell)Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy, RT sell
RT Maxbag ProtectionStart of RTStrategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy, RT sell
Trail Me RTRT buyStrategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT sell
Trail Me RT SellRT sellStrategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy
Trail Me Buy RangeStrategy buy, RT Buy, DCA buyStrategy sell, RT sell, Close, Stop limit, RT buyback
Trail Me RT Sell RangeRT sellStrategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy