💬 Forum

Boll

🏆 League #47 / 1910

remiotore/ccxt-freqtrade/strategies/BBV1.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
Indicators Bollinger_Bands talib technical
Concepts trailing
Methods leverage
6 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
from pandas import DataFrame
from freqtrade.persistence import Trade
from typing import Optional
from freqtrade.strategy import IStrategy, IntParameter
import talib.abstract as ta
from technical import qtpylib
from datetime import datetime

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

    minimal_roi = {"0": 0.6}
    stoploss = -0.2
    trailing_stop = True
    trailing_stop_positive = 0.012
    trailing_stop_positive_offset = 0.1
    trailing_only_offset_is_reached = True
    order_types = {'entry': 'market', 'exit': 'market', 'stoploss': 'market', 'stoploss_on_exchange': True}

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

    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        # Hitung Bollinger Bands
        dataframe[['bbl', 'bbm', 'bbu']] = qtpylib.bollinger_bands(
            qtpylib.typical_price(dataframe),
            window=9,
            stds=2
        )[['lower', 'mid', 'upper']]
        
        return dataframe
    
    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        
        dataframe.loc[
            (dataframe['close'] < dataframe['bbu']) &  # Harga close berada di bawah Bollinger Band Upper
            (dataframe['high'] >= dataframe['bbu']), # Harga sebelumnya menyentuh atau melewati Bollinger Band Upper
            ['enter_long', 'enter_tag']
        ] = (1, 'Momentum Long')
        
        dataframe.loc[
            (dataframe['close'] > dataframe['bbl']) &
            (dataframe['low'] <= dataframe['bbl']),
            ['enter_short', 'enter_tag']
        ] = (1, 'Momentum Short')
    
        return dataframe

    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (dataframe['close'] < dataframe['bbm']),
            ['exit_long', 'exit_tag']
        ] = (1, 'Trend Down')
    
        dataframe.loc[
            (dataframe['close'] > dataframe['bbm']),
            ['exit_short', 'exit_tag']
        ] = (1, 'Trend Up')

        return dataframe