import talib.abstract as ta from pandas import DataFrame import freqtrade.vendor.qtpylib.indicators as qtpylib from freqtrade.strategy.interface import IStrategy class strato_244(IStrategy): """ Default Strategy provided by freqtrade bot. Please do not modify this strategy, it's intended for internal use only. Please look at the SampleStrategy in the user_data/strategy directory or strategy repository https://github.com/freqtrade/freqtrade-strategies for samples and inspiration. """ INTERFACE_VERSION = 2 minimal_roi = { "0": 0.005,"12":0.002,"24":0.001,"72":0 } stoploss = -0.0021 ticker_interval = '3m' order_types = { 'buy': 'limit', 'sell': 'market', 'stoploss': 'market', 'stoploss_on_exchange': False } startup_candle_count: int = 20 order_time_in_force = { 'buy': 'gtc', 'sell': 'gtc', } def informative_pairs(self): """ Define additional, informative pair/interval combinations to be cached from the exchange. These pair/interval combinations are non-tradeable, unless they are part of the whitelist as well. For more information, please consult the documentation :return: List of tuples in the format (pair, interval) Sample: return [("ETH/USDT", "5m"), ("BTC/USDT", "15m"), ] """ return [] def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame Performance Note: For the best performance be frugal on the number of indicators you are using. Let uncomment only the indicator you are using in your strategies or your hyperopt configuration, otherwise you will waste your memory and CPU usage. :param dataframe: Dataframe with data from the exchange :param metadata: Additional information, like the currently traded pair :return: a Dataframe with all mandatory indicators for the strategies """ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=21, stds=2.7) dataframe['bblow'] = bollinger['lower'] bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=21, stds=3) dataframe['bbhigh'] = bollinger2['upper'] return dataframe def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the buy signal for the given dataframe :param dataframe: DataFrame :param metadata: Additional information, like the currently traded pair :return: DataFrame with buy column """ dataframe.loc[ ( ((dataframe['close']+dataframe['low'])/2) DataFrame: """ Based on TA indicators, populates the sell signal for the given dataframe :param dataframe: DataFrame :param metadata: Additional information, like the currently traded pair :return: DataFrame with buy column """ dataframe.loc[ ( dataframe['high']>dataframe['bbhigh'] ), 'sell'] = 1 return dataframe