💬 Forum

SlopeV6

🏆 League #100 / 1927

remiotore/ccxt-freqtrade/my-strategies/SlopeV6.py · ★3 · ⑂2 · first seen 2026-07-16 · repo updated 2026-01-11

Basics mode: futures timeframe: 15m interface version: 3
Settings stoploss: -0.2 has minimal roi trailing hyperopt hyperopt params: 2
Indicators pandas_ta scipy talib technical
Concepts trailing
11 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
 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
import datetime
import numpy as np
import pandas_ta as pta
import talib.abstract as ta
from pandas import DataFrame
from datetime import datetime
from technical import qtpylib
from scipy.stats import linregress
from freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter, IntParameter, IStrategy)
from freqtrade.persistence import Trade
from typing import Optional, Tuple, Union
from scipy.signal import argrelextrema



class SlopeV6(IStrategy):
    INTERFACE_VERSION = 3
    
    can_short = True
    timeframe = '15m'
    use_exit_signal = True
    exit_profit_only = True
    exit_profit_offset = 0.1

    minimal_roi = { '0': 1 }

    stoploss = -0.2

    trailing_stop = True
    trailing_stop_positive = 0.012
    trailing_stop_positive_offset = 0.065
    trailing_only_offset_is_reached = True

    max_open_trades = -1

    timeperiod =     IntParameter(   1,  120, space='buy', default=34,  optimize=False)
    volume_pct = DecimalParameter(0.0, 100.0, space='buy', default=3.5, optimize=False)

    @property
    def plot_config(self):
        plot_config = {
            'main_plot' : { },
            'subplots' : {
                'Directional Indicator' : {
                    'plus_di'    : { 'color' : 'red'   },
                    'minus_di'   : { 'color' : 'blue'  },
                    'volume_pct' : { 'color' : 'black' },
                }
            }
        }

        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:
        dataframe['volume_pct'] = dataframe['volume'].pct_change(self.timeperiod.value)
        dataframe['plus_di'] = ta.PLUS_DI(dataframe, timeperiod=self.timeperiod.value)
        dataframe['minus_di'] = ta.MINUS_DI(dataframe, timeperiod=self.timeperiod.value)
        dataframe['maximum'] = np.where( dataframe['minus_di'].shift(1) < dataframe['minus_di'], dataframe['close'], np.nan )
        dataframe['minimum'] = np.where( dataframe['minus_di'].shift(1) > dataframe['minus_di'], dataframe['close'], np.nan )
        
        return dataframe

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

        dataframe.loc[
            (
                (dataframe['volume_pct'] > self.volume_pct.value) &
                (dataframe['minus_di']   < dataframe['plus_di']) &
                (dataframe['volume']     > 0)
            ),
        'enter_long'] = 1

        dataframe.loc[
            (
                (dataframe['volume_pct'] > self.volume_pct.value) &
                (dataframe['minus_di']   > dataframe['plus_di']) &
                (dataframe['volume']     > 0)
            ),
        'enter_short'] = 1

        return dataframe

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

        dataframe.loc[
            (
                (dataframe['maximum'].notnull()) &
                (dataframe['volume'] > 0)
            ),
        'exit_long'] = 1

        dataframe.loc[
            (
                (dataframe['minimum'].notnull()) &
                (dataframe['volume'] > 0)
            ),
        'exit_short'] = 1

        return dataframe