💬 Forum

GeneratedStrategy

🏆 League #404 / 1941

jimbokl/freqtradeui/user_data/strategies/GeneratedStrategy.py · ★1 · first seen 2026-07-16 · repo updated 2025-07-01

Basics mode: spot timeframe: 1h interface version: 3
Settings stoploss: -0.1 has minimal roi startup candle count: 30
Indicators EMA 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Generated strategy from RDP visual builder
# PRAGMA pylint: disable=missing-docstring, invalid-name, pointless-string-statement


import pandas as pd

import numpy as np

from freqtrade.strategy import IStrategy, merge_informative_pair

from pandas import DataFrame

import talib.abstract as ta

import freqtrade.vendor.qtpylib.indicators as qtpylib


class GeneratedStrategy(IStrategy):
    """
    Generated strategy class
    """
    
    # Strategy interface version
    INTERFACE_VERSION = 3
    
    # Minimal ROI designed for the strategy
    minimal_roi = {
        "60": 0.01,
        "30": 0.02,
        "0": 0.04
    }
    
    # Optimal stoploss
    stoploss = -0.10
    
    # Optimal timeframe for the strategy
    timeframe = '1h'  # Используем 1h так как у нас есть данные для этого timeframe
    
    # Can this strategy go short?
    can_short: bool = False
    
    # These values can be overridden in the config
    use_exit_signal = True
    exit_profit_only = False
    ignore_roi_if_entry_signal = False
    
    # Number of candles the strategy requires before producing valid signals
    startup_candle_count: int = 30
    
    def __init__(self, config: dict = None):
        """Инициализация стратегии с конфигурацией"""
        if config is None:
            config = {}
        super().__init__(config)

    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        """
        Adds several different TA indicators to the given DataFrame
        """

        dataframe['indicator_0x16a3000a0'] = ta.EMA(dataframe['close'], timeperiod=12)

        dataframe['indicator_0x16a301810'] = ta.EMA(dataframe['close'], timeperiod=26)

        dataframe['math_0x16a301a80'] = dataframe['indicator_0x16a3000a0'] - dataframe['indicator_0x16a301810']

        
        return dataframe

    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        """
        Based on TA indicators, populates the entry signal for the given dataframe
        """
        # Initialize entry columns
        dataframe['enter_long'] = 0
        dataframe['enter_short'] = 0
        

        dataframe.loc[(dataframe['math_0x16a301a80'] > 0), 'enter_long'] = 1

        
        return dataframe

    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        """
        Based on TA indicators, populates the exit signal for the given dataframe
        """
        # Initialize exit columns
        dataframe['exit_long'] = 0
        dataframe['exit_short'] = 0
        

        dataframe.loc[(dataframe['math_0x16a301a80'] < 0), 'exit_long'] = 1

        
        return dataframe