💬 Forum

BadoV1

⛔ Not ranked — lookahead

remiotore/ccxt-freqtrade/strategies/BadoV1.py · ★3 · ⑂2 · first seen 2026-07-16 · repo updated 2026-01-11 · ⬇ 1 download

Basics mode: futures timeframe: 15m interface version: 3
Settings stoploss: -0.999 has minimal roi
Indicators scipy talib technical

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
 97
 98
 99
100
101
102
103
104
import datetime
import numpy as np
import talib.abstract as ta
from pandas import DataFrame
from datetime import datetime
from technical import qtpylib
from freqtrade.strategy import IStrategy
from scipy.signal import argrelextrema


class BadoV1(IStrategy):
    INTERFACE_VERSION = 3
    
    timeframe = '15m'
    can_short = True

    minimal_roi = { '0': 1 }

    stoploss = -0.999

    trailing_stop = False

    max_open_trades = -1

    @property
    def plot_config(self):
        plot_config = {
            'main_plot' : {},
            'subplots' : {},
        }

        plot_config['main_plot']['maxima'] = {
            'plotly': {
                'mode': 'markers',
                'marker': {
                    'size': 8,
                    'line': { 'width': 2 },
                    'color': 'green'
                }
            }
        }
        plot_config['main_plot']['minima'] = {
            'plotly': {
                'mode': 'markers',
                'marker': {
                    'size': 8,
                    'line': { 'width': 2 },
                    'color': 'red'
                }
            }
        }

        return plot_config
    
    def leverage(self, pair: str, current_time: datetime, current_rate: float, proposed_leverage: float, max_leverage: float, entry_tag:str, side: str, **kwargs) -> float:
        return 10.0

    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:

        rolling_window = 64
        dataframe['rolling_max'] = dataframe['close'].rolling(window=rolling_window).max()
        dataframe['rolling_min'] = dataframe['close'].rolling(window=rolling_window).min()

        order = 5  # Window size for finding local extrema
        maxima_idx = argrelextrema(dataframe['close'].values, np.greater, order=order)[0]
        minima_idx = argrelextrema(dataframe['close'].values, np.less, order=order)[0]

        dataframe['maxima'] = np.nan
        dataframe['minima'] = np.nan

        dataframe.loc[maxima_idx, 'maxima'] = dataframe.loc[maxima_idx, 'close']
        dataframe.loc[minima_idx, 'minima'] = dataframe.loc[minima_idx, 'close']
        
        return dataframe

    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                (dataframe['minima'].notnull())
            ),
        'enter_long'] = 1

        dataframe.loc[
            (
                (dataframe['maxima'].notnull())
            ),
        'enter_short'] = 1

        return dataframe

    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                (dataframe['maxima'].notnull())
            ),
        'exit_long'] = 1

        dataframe.loc[
            (
                (dataframe['minima'].notnull())
            ),
        'exit_short'] = 1

        return dataframe