💬 Forum

X1

🏆 League #134 / 1942

win-boom/BTCquant/user_data/strategies/strats.py · first seen 2026-07-16 · repo updated 2026-06-20

Basics mode: futures timeframe: 30m interface version: 3
Settings stoploss: -0.03 has minimal roi trailing process only new candles startup candle count: 80
Indicators ADX EMA MACD ROC SMA talib
Concepts trailing
1 related strategy ( 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
from pandas import DataFrame
import talib.abstract as ta
from freqtrade.strategy import IStrategy

# Clean: no class-level leverage, just config-level futures_leverage
class X1(IStrategy):
    """15m EMA+MACD dual, aggressive exposure"""
    INTERFACE_VERSION = 3; timeframe = '15m'; can_short = True
    stoploss = -0.025; trailing_stop = True
    trailing_stop_positive = 0.005; trailing_stop_positive_offset = 0.020
    trailing_only_offset_is_reached = True
    minimal_roi = {"0": 0.08, "480": 0.05, "1440": 0.03, "4320": 0}
    max_open_trades = 12
    startup_candle_count = 200
    process_only_new_candles = True; use_exit_signal = False
    def populate_indicators(self,d,m):
        d['e10']=ta.EMA(d,10);d['e30']=ta.EMA(d,30)
        md=ta.MACD(d);d['md']=md['macd'];d['ms']=md['macdsignal']
        d['mom']=ta.ROC(d,3);d['vr']=d['volume']/ta.SMA(d['volume'],20)
        d['adx']=ta.ADX(d,14)
        return d
    def populate_entry_trend(self,d,m):
        d.loc[((d['e10']>d['e30'])&(d['md']>d['ms'])&(d['mom']>0.1)&(d['adx']>18)&(d['vr']>1.0)&(d['volume']>0)),['enter_long','enter_tag']]=(1,'L')
        d.loc[((d['e10']<d['e30'])&(d['md']<d['ms'])&(d['mom']<-0.1)&(d['adx']>18)&(d['vr']>1.0)&(d['volume']>0)),['enter_short','enter_tag']]=(1,'S')
        return d
    def populate_exit_trend(self,d,m):return d

# 30m version
class X2(IStrategy):
    """30m EMA+MACD dual, wider stops"""
    INTERFACE_VERSION = 3; timeframe = '30m'; can_short = True
    stoploss = -0.03; trailing_stop = True
    trailing_stop_positive = 0.008; trailing_stop_positive_offset = 0.025
    trailing_only_offset_is_reached = True
    minimal_roi = {"0": 0.10, "240": 0.06, "720": 0.04, "1440": 0}
    max_open_trades = 8
    startup_candle_count = 80
    process_only_new_candles = True; use_exit_signal = False
    def populate_indicators(self,d,m):
        d['e10']=ta.EMA(d,10);d['e30']=ta.EMA(d,30);d['e100']=ta.EMA(d,100)
        d['slope']=(d['e100']-d['e100'].shift(48))/d['e100'].shift(48)*100
        md=ta.MACD(d);d['md']=md['macd'];d['ms']=md['macdsignal']
        d['mom']=ta.ROC(d,1)*0.2+ta.ROC(d,3)*0.3+ta.ROC(d,6)*0.5
        d['adx']=ta.ADX(d,14);d['vr']=d['volume']/ta.SMA(d['volume'],20)
        return d
    def populate_entry_trend(self,d,m):
        d.loc[((d['slope']>-2)&(d['e10']>d['e30'])&(d['md']>d['ms'])&(d['mom']>0.15)&(d['adx']>20)&(d['vr']>1.1)&(d['volume']>0)),['enter_long','enter_tag']]=(1,'L')
        d.loc[((d['slope']<2)&(d['e10']<d['e30'])&(d['md']<d['ms'])&(d['mom']<-0.15)&(d['adx']>20)&(d['vr']>1.1)&(d['volume']>0)),['enter_short','enter_tag']]=(1,'S')
        return d
    def populate_exit_trend(self,d,m):return d