Timeframe
15m
Direction
Long Only
Stoploss
-100.0%
Trailing Stop
No
ROI
0m: 85.0%, 11343m: 40.7%, 23766m: 16.0%, 41495m: 0.0%
Interface Version
N/A
Startup Candles
N/A
Indicators
1
freqtrade/freqtrade-strategies
freqtrade/freqtrade-strategies
this is an example class, implementing a PSAR based trailing stop loss you are supposed to take the `custom_stoploss()` and `populate_indicators()` parts and adapt it to your own strategy
freqtrade/freqtrade-strategies
Strategy 003 author@: Gerald Lonlas github@: https://github.com/freqtrade/freqtrade-strategies
import talib.abstract as ta
import pandas
from pandas import DataFrame
import freqtrade.vendor.qtpylib.indicators as qtpylib
from freqtrade.strategy.interface import IStrategy
class RSI_BB(IStrategy):
ticker_interval = '1d'
timeframe = '15m'
# ROI table:
minimal_roi = {
"0": 0.85,
"11343": 0.407,
"23766": 0.16,
"41495": 0
}
# Stoploss:
stoploss = -1
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['rsi'] = ta.RSI(dataframe)
bollinger1 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)
dataframe['bb_lowerband1'] = bollinger1['lower']
bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)
dataframe['bb_upperband3'] = bollinger3['upper']
return dataframe
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe["close"] < dataframe['bb_lowerband1'])
),
'buy'] = 1
return dataframe
def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe['rsi'] > 56) &
(dataframe["close"] > dataframe['bb_upperband3'])
),
'sell'] = 1
return dataframe