💬 Forum

AtrBreakout

🏆 League #404 / 1936

HaroldZhao2025/Trading_Bot/user_data/strategies/AtrBreakout.py · ★1 · first seen 2026-07-16 · repo updated 2026-03-11

Basics mode: spot timeframe: 1h
Settings stoploss: -0.12 has minimal roi
Indicators ATR SMA 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 →

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
from freqtrade.strategy import IStrategy
from pandas import DataFrame
import talib.abstract as ta

class AtrBreakout(IStrategy):
    timeframe = "1h"
    minimal_roi = {"0": 0.05}
    stoploss = -0.12

    atr_mult = 1.5

    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe["atr"] = ta.ATR(dataframe, timeperiod=14)
        dataframe["sma"] = ta.SMA(dataframe, timeperiod=50)
        return dataframe

    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (dataframe["close"] > dataframe["sma"] + dataframe["atr"] * self.atr_mult),
            "enter_long"
        ] = 1
        return dataframe

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