RSI Pullback
Entry on a pullback in the direction of the trend (rsipullback). The direction is set by a moving average (EMA 200 by
default): long only when the closed bar is above it, short only below. Inside the trend the strategy waits for a pullback shown by
RSI and enters when the pullback ends.
- Long: price above the trend MA and RSI coming back from oversold - crossing
oversoldupwards - Short: price below the trend MA and RSI coming back from overbought - crossing
overboughtdownwards - With
entry_on_crossoff, the strategy enters right away while RSI is in the zone, without waiting for the return - Entry with a market order on a closed-bar signal
- Exit: RSI reached
exit_long_rsi/exit_short_rsi; a closed bar crossed the trend MA against the position (exit_on_trend_break); stop, target and trailing stop in ATR. The common exits from theoptionsblock work too
The bot chart shows the trend MA.
ATR stop, target and trailing stop. At entry the bot stores the ATR and computes the levels: stop = entry price ∓ stop_atr × ATR,
target = entry price ± take_atr × ATR. The trailing stop follows the best price since entry at a distance of
trail_atr × ATR and works together with the stop - whichever is closer to the price triggers. Levels are checked on every
tick against the current price and the position is closed with a market order. Levels are saved in the bot state and survive a
restart. If the position was opened manually or by another strategy, the levels are computed from its entry price and the current ATR.
⚠️ Weak spot - trend change: the pullback the strategy bought may turn out to be the start of a reversal. The ATR stop and the exit on a trend MA break protect against it.
Parameters
The rsi_pullback block in the bot settings, basic.strategy: rsipullback
rsi_len,rsi_source- RSI period and source (default 14, close)oversold- oversold level for long (default 30)overbought- overbought level for short (default 70)entry_on_cross- enter when RSI comes back from the zone (default). When off - enter while RSI is in the zoneexit_long_rsi- close long when RSI rises to this level (default 55). 0 - don't close by RSIexit_short_rsi- close short when RSI falls to this level (default 45). 0 - don't close by RSItrend_ma_type,trend_ma_source,trend_ma_len- trend MA (default EMA, close, 200)exit_on_trend_break- close the position when a closed bar crosses the trend MA against it (on by default)atr_len- ATR period for the stop, target and trailing stop (default 14)stop_atr- stop distance from the entry price in ATR (default 2). 0 - no strategy stoptake_atr- target distance from the entry price in ATR (default 0 - no target)trail_atr- trailing stop from the best price in ATR (default 0 - no trailing stop)entry_filter- extra entry filters (see below)
Entry filters entry_filter - they only restrict new entries and never block exits. All are off by default.
When several are on, an entry is allowed only if all of them pass.
trend_ma- trend filter: long only when the close is above the MA, short only below.trend_ma_type,trend_ma_source,trend_ma_len- MA type, source and period (default EMA, close, 200)adx- trend strength filter by ADX with periodadx_len(14).adx_min- enter only when ADX is at least this value (default 20),adx_max- only when it is at most this value (for range strategies). 0 - don't checkliquidity- liquidity filter: enter only if the average daily turnover (volume × price) overliquidity_daysdays (7) is at leastliquidity_min_usdt(100000 USDT)time- enter only in the given hours and weekdays, UTC.time_hours_utc- comma-separated hour ranges, the end is excluded:"8-12,14-20","22-2"- across midnight (default"0-24").time_weekdays- weekdays, 1 = Monday ... 7 = Sunday:"1-5"(default"1-7")
Backtest the strategy on historical data in the tester and run it in hamster-bot.