💬 Forum

BreakoutGammaV1

🏆 League #1470 / 1937

Zer0phucks/trading-lab/user_data/strategies/BreakoutGammaV1.py · first seen 2026-07-16 · repo updated 2026-05-05 · ⬇ 1 download

Basics mode: spot timeframe: 5m interface version: 3
Settings stoploss: -0.09 has minimal roi trailing process only new candles startup candle count: 120 hyperopt hyperopt params: 2
Indicators ATR EMA RSI talib
Concepts breakout trailing
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 →

Source

Download Raw
 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
from __future__ import annotations

from pandas import DataFrame
import talib.abstract as ta

from freqtrade.strategy import DecimalParameter, IStrategy


class BreakoutGammaV1(IStrategy):
    INTERFACE_VERSION = 3

    timeframe = "5m"
    can_short = False
    process_only_new_candles = True
    startup_candle_count = 120

    minimal_roi = {"0": 0.05, "120": 0.02, "360": 0.0}
    stoploss = -0.09
    trailing_stop = True
    trailing_stop_positive = 0.02
    trailing_stop_positive_offset = 0.045
    trailing_only_offset_is_reached = True

    volume_mult = DecimalParameter(1.2, 3.0, default=1.6, decimals=1, space="buy")
    exit_rsi = DecimalParameter(45.0, 65.0, default=52.0, decimals=1, space="sell")

    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe["high_20"] = dataframe["high"].rolling(20).max().shift(1)
        dataframe["ema_50"] = ta.EMA(dataframe, timeperiod=50)
        dataframe["rsi"] = ta.RSI(dataframe, timeperiod=14)
        dataframe["atr"] = ta.ATR(dataframe, timeperiod=14)
        dataframe["atr_mean_50"] = dataframe["atr"].rolling(50).mean()
        dataframe["volume_mean_30"] = dataframe["volume"].rolling(30).mean()
        return dataframe

    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                (dataframe["close"] > dataframe["high_20"])
                & (dataframe["close"] > dataframe["ema_50"])
                & (dataframe["atr"] > dataframe["atr_mean_50"])
                & (dataframe["volume"] > dataframe["volume_mean_30"] * self.volume_mult.value)
            ),
            "enter_long",
        ] = 1
        return dataframe

    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                (dataframe["close"] < dataframe["ema_50"])
                | (dataframe["rsi"] < self.exit_rsi.value)
            ),
            "exit_long",
        ] = 1
        return dataframe