Reversal Trading (RT)
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 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 below the initial purchase, RT can continue accumulating more quote currency. This process lowers the average buy price so a later price increase can allow selling the total accumulated amount for an overall profit.
Trading fees incurred during Reversal Trading are accounted for in its calculations.

Note that this example is kept simple intentionally. Prices don't have to go straight down for RT to successfully accumulate.
Using reversal trading can be challenging to set up and understand. Use it only if you have a clear plan and the time to monitor outcomes.
How It Works
Reversal Trading begins when the current price falls a set percentage (defined by RT_GAIN) below the last purchase price. The initial bag (the amount of quote currency held) is sold for base currency (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 further accumulation of 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.
When using TM_RT_SELL (Trailing Stop/Take Profit for RT Sell) or when the bb (Bollinger Bands) strategy is the primary sell method, an RT_SELL can occur at a higher rate than the preceding RT_BUY. This can help reach a profitable exit point sooner.
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 the 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 is bought back (an RT_BUYBACK action) to resume normal trading. Alternatively, RT_BUY_UP_LEVEL lets you 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_BEFOREto 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 settingIGNORE_TRADES_BEFORE. - Use
RT_MAXBAG_PROTECTIONto 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

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

RT Process for bb

LOW_BB/HIGH_BB in reversal trading use the same settings as with regular trading on bb.
RT Settings
| Label | Config Parameter | Default Value | Detailed Description |
|---|---|---|---|
| RT enabled | RT_ENABLED | false | Enables the Reversal Trading (RT) feature. Caution: Disabling RT while an RT cycle is active may require manual adjustments to trade tracking data. |
| RT buy level | RT_BUY_LEVEL | 2 | Percentage price drop required from the last RT_SELL price (or initial buy price if it is the first RT step) to trigger an RT_BUY. |
| RT gain | RT_GAIN | 1.5 | Initial percentage drop from the last regular buy price that triggers the first RT_SELL action. Also used to calculate subsequent RT_SELL levels from RT_BUY levels if not using TM_RT_SELL. |
| RT buy up level | RT_BUY_UP_LEVEL | 0 | 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 once | RT_ONCE | false | If true, the trading pair will be automatically disabled after an RT cycle completes profitably, preventing further trades on that pair. |
| RT once and continue | RT_ONCE_AND_CONTINUE | false | If true, after an RT cycle ends profitably, Reversal Trading is disabled for the pair, but regular strategy trading continues. |
| RT max bag protection | RT_MAXBAG_PROTECTION | 10 | Prevents RT from starting if the current price is below the average purchase price by more than this percentage. |
| RT trend enabled | RT_TREND_ENABLED | false | If enabled, incorporates trend analysis (e.g., using TREND_EMA settings) to potentially delay RT_BUY or RT_SELL orders. |
Overview of Effects on Different Order Types
| Config Parameter | Affected Order Types | Not Affected Order Types |
|---|---|---|
| RT Enabled | RT buy, RT buyback, RT sell | Strategy buy, Strategy sell, Close, DCA buy, Stop limit |
| RT Gain | RT sell | Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy |
| RT Buy Level | RT buy | Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT sell |
| RT Sell Up | RT sell | Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy |
| RT Buy Up Level | RT buyback | Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT sell, RT buy |
| RT Trend Enabled | RT buy, RT sell | Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback |
| RT Once | RT cycle (until final strategy sell) | Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy, RT sell |
| RT Once And Continue | RT cycle (until final strategy sell) | Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy, RT sell |
| RT Maxbag Protection | Start of RT | Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy, RT sell |
| Trail Me RT | RT buy | Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT sell |
| Trail Me RT Sell | RT sell | Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy |
| Trail Me Buy Range | Strategy buy, RT Buy, DCA buy | Strategy sell, RT sell, Close, Stop limit, RT buyback |
| Trail Me RT Sell Range | RT sell | Strategy buy, Strategy sell, Close, DCA buy, Stop limit, RT buyback, RT buy |