Timeframe
5m
Direction
Long Only
Stoploss
-5.0%
Trailing Stop
No
ROI
0m: 10.0%, 240m: 5.0%
Interface Version
N/A
Startup Candles
40
Indicators
4
freqtrade/freqtrade-strategies
Strategy 003 author@: Gerald Lonlas github@: https://github.com/freqtrade/freqtrade-strategies
"""Strategy: Coppock Curve Strategy"""
import talib.abstract as ta
from freqtrade.strategy import IStrategy
from pandas import DataFrame
class CoppockCurveStrategy(IStrategy):
timeframe = "5m"
minimal_roi = {"0": 0.10, "240": 0.05}
stoploss = -0.05
startup_candle_count = 40
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
roc14 = ta.ROC(dataframe, timeperiod=14)
roc11 = ta.ROC(dataframe, timeperiod=11)
dataframe["coppock"] = ta.WMA(roc14 + roc11, timeperiod=10)
dataframe["coppock_prev"] = dataframe["coppock"].shift(1)
dataframe["rsi"] = ta.RSI(dataframe, timeperiod=14)
dataframe["ema50"] = ta.EMA(dataframe, timeperiod=50)
dataframe["volume_ma"] = dataframe["volume"].rolling(20).mean()
return dataframe
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(dataframe["coppock"] > 0) & (dataframe["coppock_prev"] <= 0)
& (dataframe["close"] > dataframe["ema50"])
& (dataframe["rsi"] < 68)
& (dataframe["volume"] > dataframe["volume_ma"])
& (dataframe["volume"] > 0),
"enter_long",
] = 1
return dataframe
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(dataframe["coppock"] < 0) | (dataframe["rsi"] > 74),
"exit_long",
] = 1
return dataframe