remove unused indicators from default_strategy
This commit is contained in:
parent
5e654620b7
commit
0135784589
@ -4,7 +4,6 @@ import talib.abstract as ta
|
|||||||
from pandas import DataFrame
|
from pandas import DataFrame
|
||||||
|
|
||||||
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
||||||
from freqtrade.indicator_helpers import fishers_inverse
|
|
||||||
from freqtrade.strategy.interface import IStrategy
|
from freqtrade.strategy.interface import IStrategy
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +74,8 @@ class DefaultStrategy(IStrategy):
|
|||||||
dataframe['adx'] = ta.ADX(dataframe)
|
dataframe['adx'] = ta.ADX(dataframe)
|
||||||
|
|
||||||
# Awesome oscillator
|
# Awesome oscillator
|
||||||
dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)
|
# dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Commodity Channel Index: values Oversold:<-100, Overbought:>100
|
# Commodity Channel Index: values Oversold:<-100, Overbought:>100
|
||||||
dataframe['cci'] = ta.CCI(dataframe)
|
dataframe['cci'] = ta.CCI(dataframe)
|
||||||
@ -87,16 +87,15 @@ class DefaultStrategy(IStrategy):
|
|||||||
dataframe['macdhist'] = macd['macdhist']
|
dataframe['macdhist'] = macd['macdhist']
|
||||||
|
|
||||||
# MFI
|
# MFI
|
||||||
dataframe['mfi'] = ta.MFI(dataframe)
|
# dataframe['mfi'] = ta.MFI(dataframe)
|
||||||
|
|
||||||
# Minus Directional Indicator / Movement
|
# Minus Directional Indicator / Movement
|
||||||
dataframe['minus_dm'] = ta.MINUS_DM(dataframe)
|
# dataframe['minus_dm'] = ta.MINUS_DM(dataframe)
|
||||||
dataframe['minus_di'] = ta.MINUS_DI(dataframe)
|
dataframe['minus_di'] = ta.MINUS_DI(dataframe)
|
||||||
|
|
||||||
# Plus Directional Indicator / Movement
|
# Plus Directional Indicator / Movement
|
||||||
dataframe['plus_dm'] = ta.PLUS_DM(dataframe)
|
# dataframe['plus_dm'] = ta.PLUS_DM(dataframe)
|
||||||
dataframe['plus_di'] = ta.PLUS_DI(dataframe)
|
dataframe['plus_di'] = ta.PLUS_DI(dataframe)
|
||||||
dataframe['minus_di'] = ta.MINUS_DI(dataframe)
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# ROC
|
# ROC
|
||||||
@ -106,15 +105,15 @@ class DefaultStrategy(IStrategy):
|
|||||||
dataframe['rsi'] = ta.RSI(dataframe)
|
dataframe['rsi'] = ta.RSI(dataframe)
|
||||||
|
|
||||||
# Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)
|
# Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)
|
||||||
dataframe['fisher_rsi'] = fishers_inverse(dataframe['rsi'])
|
# dataframe['fisher_rsi'] = fishers_inverse(dataframe['rsi'])
|
||||||
|
|
||||||
# Inverse Fisher transform on RSI normalized, value [0.0, 100.0] (https://goo.gl/2JGGoy)
|
# Inverse Fisher transform on RSI normalized, value [0.0, 100.0] (https://goo.gl/2JGGoy)
|
||||||
dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)
|
# dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)
|
||||||
|
|
||||||
# Stoch
|
# Stoch
|
||||||
stoch = ta.STOCH(dataframe)
|
# stoch = ta.STOCH(dataframe)
|
||||||
dataframe['slowd'] = stoch['slowd']
|
# dataframe['slowd'] = stoch['slowd']
|
||||||
dataframe['slowk'] = stoch['slowk']
|
# dataframe['slowk'] = stoch['slowk']
|
||||||
|
|
||||||
# Stoch fast
|
# Stoch fast
|
||||||
stoch_fast = ta.STOCHF(dataframe)
|
stoch_fast = ta.STOCHF(dataframe)
|
||||||
@ -134,37 +133,39 @@ class DefaultStrategy(IStrategy):
|
|||||||
# Because ta.BBANDS implementation is broken with small numbers, it actually
|
# Because ta.BBANDS implementation is broken with small numbers, it actually
|
||||||
# returns middle band for all the three bands. Switch to qtpylib.bollinger_bands
|
# returns middle band for all the three bands. Switch to qtpylib.bollinger_bands
|
||||||
# and use middle band instead.
|
# and use middle band instead.
|
||||||
dataframe['blower'] = ta.BBANDS(dataframe, nbdevup=2, nbdevdn=2)['lowerband']
|
# dataframe['blower'] = ta.BBANDS(dataframe, nbdevup=2, nbdevdn=2)['lowerband']
|
||||||
|
|
||||||
# Bollinger bands
|
# Bollinger bands
|
||||||
bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
|
bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
|
||||||
dataframe['bb_lowerband'] = bollinger['lower']
|
dataframe['bb_lowerband'] = bollinger['lower']
|
||||||
dataframe['bb_middleband'] = bollinger['mid']
|
dataframe['bb_middleband'] = bollinger['mid']
|
||||||
dataframe['bb_upperband'] = bollinger['upper']
|
dataframe['bb_upperband'] = bollinger['upper']
|
||||||
|
"""
|
||||||
# EMA - Exponential Moving Average
|
# EMA - Exponential Moving Average
|
||||||
dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)
|
dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)
|
||||||
dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)
|
dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)
|
||||||
dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)
|
|
||||||
dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)
|
dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)
|
||||||
dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)
|
dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)
|
||||||
|
"""
|
||||||
|
dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)
|
||||||
|
|
||||||
# SAR Parabol
|
# SAR Parabol
|
||||||
dataframe['sar'] = ta.SAR(dataframe)
|
# dataframe['sar'] = ta.SAR(dataframe)
|
||||||
|
|
||||||
# SMA - Simple Moving Average
|
# SMA - Simple Moving Average
|
||||||
dataframe['sma'] = ta.SMA(dataframe, timeperiod=40)
|
dataframe['sma'] = ta.SMA(dataframe, timeperiod=40)
|
||||||
|
|
||||||
# TEMA - Triple Exponential Moving Average
|
# TEMA - Triple Exponential Moving Average
|
||||||
dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)
|
# dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)
|
||||||
|
|
||||||
|
"""
|
||||||
# Cycle Indicator
|
# Cycle Indicator
|
||||||
# ------------------------------------
|
# ------------------------------------
|
||||||
# Hilbert Transform Indicator - SineWave
|
# Hilbert Transform Indicator - SineWave
|
||||||
hilbert = ta.HT_SINE(dataframe)
|
hilbert = ta.HT_SINE(dataframe)
|
||||||
dataframe['htsine'] = hilbert['sine']
|
dataframe['htsine'] = hilbert['sine']
|
||||||
dataframe['htleadsine'] = hilbert['leadsine']
|
dataframe['htleadsine'] = hilbert['leadsine']
|
||||||
|
"""
|
||||||
# Pattern Recognition - Bullish candlestick patterns
|
# Pattern Recognition - Bullish candlestick patterns
|
||||||
# ------------------------------------
|
# ------------------------------------
|
||||||
"""
|
"""
|
||||||
@ -216,6 +217,7 @@ class DefaultStrategy(IStrategy):
|
|||||||
dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]
|
dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
# Chart type
|
# Chart type
|
||||||
# ------------------------------------
|
# ------------------------------------
|
||||||
# Heikinashi stategy
|
# Heikinashi stategy
|
||||||
@ -224,7 +226,7 @@ class DefaultStrategy(IStrategy):
|
|||||||
dataframe['ha_close'] = heikinashi['close']
|
dataframe['ha_close'] = heikinashi['close']
|
||||||
dataframe['ha_high'] = heikinashi['high']
|
dataframe['ha_high'] = heikinashi['high']
|
||||||
dataframe['ha_low'] = heikinashi['low']
|
dataframe['ha_low'] = heikinashi['low']
|
||||||
|
"""
|
||||||
return dataframe
|
return dataframe
|
||||||
|
|
||||||
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||||
|
Loading…
Reference in New Issue
Block a user