Freqtrade Strategy

CofiBitStrategy

5m candlesOscillator reversalSpot, long only

Tested 1 Jun 2023 – 30 May 2025
Rank 27 of 27 by return

CofiBitStrategy turned $1,000 into $194 (−80.6%) over 729 days, while holding Bitcoin returned +288.1% and an equal mix of the ten coins +194.8%. Its worst drawdown was a severe 80.6%, deep enough that most people would have switched it off. With a 25% win rate and a profit factor of 0.23, losses outweighed gains. Once the balance fell below the $200 stake, it could no longer open trades and stopped.

CofiBitStrategy account balance compared with holding Bitcoin$0$1,000$2,000$3,000$4,000JulOctJan 2024AprJulOctJan 2025AprCofiBitStrategy $194BTC hold $3,880
Account balance from $1,000 (closed trades, daily). Dashed line: $1,000 held in BTC over the same days.
Total return−80.6%$194 final balance
Max drawdown80.6%1 Jun 2023 to 9 Nov 2023
Win rate24.8%613 wins / 1,855 losses
Profit factor0.23Gross wins ÷ gross losses
Trades2,4693.4 per day
Average trade−0.16%after fees
Average hold30mwinners 17m, losers 35m
Annualised (CAGR)−56.0%Sharpe -22.78 · Sortino -26.91

How CofiBitStrategy trades

CofiBitStrategy enters when the candle opens below the 5-period EMA of lows, the fast stochastic crosses up from below 25 and ADX is above 25. It exits when price opens above the EMA of highs or the stochastic crosses above 75.

A tiered take-profit (10% at once, falling to 5% after 40 minutes) keeps trades short. The 25% stoploss is far wider than the typical win.

Rules at a glance

Indicators
Fast Stochastic, EMA 5 of high / low / close, ADX
Take-profit (minimal ROI)
10% from entry; 7% after 20m; 6% after 30m; 5% after 40m
Stoploss
−25%
Trailing stop
Off
Exit signal
Used

Results by month

Profit or loss in USDT for trades closed in each month.

JFMAMJJASOND2023-199-143-185-130-123-25

Results by coin

PairTradesWin rateProfit (USDT)Avg. hold
AVAX/USDT16141.0%−28.0131m
XRP/USDT23230.6%−50.8528m
DOGE/USDT22422.8%−68.5729m
BNB/USDT18720.9%−70.3034m
DOT/USDT26026.9%−76.1230m
SOL/USDT25341.5%−80.7332m
ADA/USDT23225.9%−95.5832m
LINK/USDT28831.9%−98.3032m
ETH/USDT2969.5%−116.3429m
BTC/USDT3369.2%−120.9128m

Why trades closed

Exit reasonTradesWin rateProfit (USDT)
Exit signal246924.8%−805.72

The code

CofiBitStrategy comes from the community freqtrade-strategies repository (GPL-3.0). These are the parts that decide when it trades; the full file is 94 lines.

Entry rules
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
    dataframe.loc[
        (
            (dataframe['open'] < dataframe['ema_low']) &
            (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &
            (dataframe['fastk'] < self.buy_fastx.value) &
            (dataframe['fastd'] < self.buy_fastx.value) &
            (dataframe['adx'] > self.buy_adx.value)
        ),
        'enter_long'] = 1

    return dataframe
Exit rules
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
    dataframe.loc[
        (
            (dataframe['open'] >= dataframe['ema_high'])
        ) |
        (
            (qtpylib.crossed_above(dataframe['fastk'], self.sell_fastx.value)) |
            (qtpylib.crossed_above(dataframe['fastd'], self.sell_fastx.value))
        ),
        'exit_long'] = 1

    return dataframe
Indicators
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
    stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)
    dataframe['fastd'] = stoch_fast['fastd']
    dataframe['fastk'] = stoch_fast['fastk']
    dataframe['ema_high'] = ta.EMA(dataframe, timeperiod=5, price='high')
    dataframe['ema_close'] = ta.EMA(dataframe, timeperiod=5, price='close')
    dataframe['ema_low'] = ta.EMA(dataframe, timeperiod=5, price='low')
    dataframe['adx'] = ta.ADX(dataframe)

    return dataframe

Reproduce this test

With freqtrade installed (see our Docker guide), download the data and run the same backtest:

freqtrade download-data --exchange binance --pairs ADA/USDT AVAX/USDT BNB/USDT BTC/USDT DOGE/USDT DOT/USDT ETH/USDT LINK/USDT SOL/USDT XRP/USDT --timeframes 5m --timerange 20230501-20250530
freqtrade backtesting --strategy CofiBitStrategy --timeframe 5m \
  --timerange 20230601-20250530 --dry-run-wallet 1000 --stake-amount 200 --max-open-trades 5 --fee 0.001

Results can differ slightly with a different data source or freqtrade version. See how we test.