this strategy is based around the idea of generating a lot of potential buys and making tiny profits on each trade
Timeframe
1m
Direction
Long Only
Stoploss
-50.0%
Trailing Stop
No
ROI
0m: 1.0%
Interface Version
N/A
Startup Candles
N/A
Indicators
8
freqtrade/freqtrade-strategies
Strategy 003 author@: Gerald Lonlas github@: https://github.com/freqtrade/freqtrade-strategies
# --- Do not remove these libs ---
import numpy # noqa
# --------------------------------
# --------------------------------
import talib.abstract as ta
from pandas import DataFrame
import coingro.vendor.qtpylib.indicators as qtpylib
from coingro.strategy.interface import IStrategy
class SmoothScalp(IStrategy):
"""
this strategy is based around the idea of generating a lot of potential buys and making
tiny profits on each trade
we recommend to have at least 60 parallel trades at any time to cover non avoidable losses
"""
# Minimal ROI designed for the strategy.
# This attribute will be overridden if the config file contains "minimal_roi"
minimal_roi = {"0": 0.01}
# Optimal stoploss designed for the strategy
# This attribute will be overridden if the config file contains "stoploss"
# should not be below 3% loss
stoploss = -0.5
# Optimal timeframe for the strategy
# the shorter the better
timeframe = "1m"
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe["ema_high"] = ta.EMA(dataframe, timeperiod=5, price="high")
dataframe["ema_close"] = ta.EMA(dataframe, timeperiod=5, price="close")
dataframe["ema_low"] = ta.EMA(dataframe, timeperiod=5, price="low")
stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)
dataframe["fastd"] = stoch_fast["fastd"]
dataframe["fastk"] = stoch_fast["fastk"]
dataframe["adx"] = ta.ADX(dataframe)
dataframe["cci"] = ta.CCI(dataframe, timeperiod=20)
dataframe["rsi"] = ta.RSI(dataframe, timeperiod=14)
dataframe["mfi"] = ta.MFI(dataframe)
# required for graphing
bollinger = qtpylib.bollinger_bands(dataframe["close"], window=20, stds=2)
dataframe["bb_lowerband"] = bollinger["lower"]
dataframe["bb_upperband"] = bollinger["upper"]
dataframe["bb_middleband"] = bollinger["mid"]
macd = ta.MACD(dataframe)
dataframe["macd"] = macd["macd"]
dataframe["macdsignal"] = macd["macdsignal"]
dataframe["macdhist"] = macd["macdhist"]
dataframe["cci"] = ta.CCI(dataframe)
return dataframe
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(
(dataframe["open"] < dataframe["ema_low"])
& (dataframe["adx"] > 30)
& (dataframe["mfi"] < 30)
& (
(dataframe["fastk"] < 30)
& (dataframe["fastd"] < 30)
& (qtpylib.crossed_above(dataframe["fastk"], dataframe["fastd"]))
)
& (dataframe["cci"] < -150)
)
),
"buy",
] = 1
return dataframe
def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(
((dataframe["open"] >= dataframe["ema_high"]))
| (
(qtpylib.crossed_above(dataframe["fastk"], 70))
| (qtpylib.crossed_above(dataframe["fastd"], 70))
)
)
& (dataframe["cci"] > 150)
),
"sell",
] = 1
return dataframe