💬 Forum

DryRunRsiStrategy

🏆 League #1162 / 1962

chenshiyue17-create/mmmmm/user_data/strategies/DryRunRsiStrategy.py · first seen 2026-07-16 · repo updated 2026-06-12

Basics mode: spot timeframe: 5m interface version: 3
Settings stoploss: -0.08 has minimal roi startup candle count: 30
Indicators RSI talib
15 related strategies ( identical code, similar name)

Each tile is a different kind of check — from an instant code lint to full sandboxed backtests and forward tests on recent data. Not sure what a check actually proves? See the FAQ →

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from datetime import datetime

import talib.abstract as ta
from pandas import DataFrame

from freqtrade.strategy import IStrategy


class DryRunRsiStrategy(IStrategy):
    """Conservative dry-run RSI example for deployment smoke tests."""

    INTERFACE_VERSION = 3

    timeframe = "5m"
    startup_candle_count = 30
    can_short = False

    minimal_roi = {
        "0": 0.03,
        "60": 0.015,
        "120": 0
    }

    stoploss = -0.08
    trailing_stop = False

    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe["rsi"] = ta.RSI(dataframe, timeperiod=14)
        return dataframe

    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                (dataframe["rsi"] < 30)
                & (dataframe["volume"] > 0)
            ),
            "enter_long",
        ] = 1
        return dataframe

    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                (dataframe["rsi"] > 70)
                & (dataframe["volume"] > 0)
            ),
            "exit_long",
        ] = 1
        return dataframe

    def confirm_trade_entry(
        self,
        pair: str,
        order_type: str,
        amount: float,
        rate: float,
        time_in_force: str,
        current_time: datetime,
        entry_tag: str | None,
        side: str,
        **kwargs,
    ) -> bool:
        return amount > 0 and rate > 0