Condition
stochastic Rsi below 20 stoch_fast = ta.STOCHF(dataframe, 14, 7, 0, 9, 0)
Dataframe close below lower Kertnel channel
Dataframe ADX > 25
D+ Above D-
Trigger
K crossed Above D
Roi 0.005 &
Stop Loss 0.01
Smooth K set to 7 / Smooth D set to 9
Trigger
(qtpylib.crossed_above(dataframe['fastk_rsi'], dataframe['fastd_rsi'])) &
1C
(dataframe['fastd_rsi'] < 20) &
(dataframe['fastk_rsi'] < 20) &
2C
(dataframe['close'] < dataframe["kc_lowerband"]) &
3C
(dataframe['adx'] > 25) &
4C
(dataframe['plus_di'] > dataframe['minus_di']) &
................................................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
here's up , it's my plan to turn as a strategy. In Simplify. One Trigger and 4 Conditions There. The trigger should be those two Stochastic Rsi lines crossed each other and the conditions as stohchRSI at all below 20, The Candlestick close below a lower band of Kertnel's channel, ADX higher than 25, and Plus DI already above minus DI. And That's The strategy just down here as I'm was working over it. And The Error is
"Impossible to load Strategy 'X'. This class does not exist or contains Python code errors."
Please help me get it to work! I'm will be grateful.
import numpy as np # noqa
import pandas as pd # noqa
from pandas import DataFrame
from freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,
IStrategy, IntParameter)
import talib.abstract as ta
import freqtrade.vendor.qtpylib.indicators as qtpylib
class X(IStrategy):
INTERFACE_VERSION = 2
minimal_roi = {
"3": 0.005,
"4": 0
}
stoploss = -0.01
trailing_stop = False
timeframe = '1m'
process_only_new_candles = False
use_sell_signal = False
sell_profit_only = False
ignore_roi_if_buy_signal = False
startup_candle_count: int = 300
order_types = {
'buy': 'limit',
'sell': 'limit',
'stoploss': 'market',
'stoploss_on_exchange': False
}
order_time_in_force = {
'buy': 'gtc',
'sell': 'gtc'
}
plot_config = {
'main_plot': {
'tema': {},
'sar': {'color': 'white'},
},
'subplots': {
"MACD": {
'macd': {'color': 'blue'},
'macdsignal': {'color': 'orange'},
},
"RSI": {
'rsi': {'color': 'red'},
}
}
}
def informative_pairs(self):
return []
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['adx'] = ta.ADX(dataframe)
dataframe['plus_di'] = ta.PLUS_DI(dataframe)
dataframe['minus_di'] = ta.MINUS_DI(dataframe)
keltner = qtpylib.keltner_channel(dataframe)
dataframe["kc_upperband"] = keltner["upper"]
dataframe["kc_lowerband"] = keltner["lower"]
dataframe["kc_middleband"] = keltner["mid"]
dataframe["kc_percent"] = (
(dataframe["close"] - dataframe["kc_lowerband"]) /
(dataframe["kc_upperband"] - dataframe["kc_lowerband"])
)
dataframe["kc_width"] = (
(dataframe["kc_upperband"] - dataframe["kc_lowerband"]) / dataframe["kc_middleband"]
)
stoch_rsi = ta.STOCHRSI(dataframe)
dataframe['fastd_rsi'] = stoch_rsi['fastd']
dataframe['fastk_rsi'] = stoch_rsi['fastk']
return dataframe
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(qtpylib.crossed_above(dataframe['fastk_rsi'], dataframe['fastd_rsi'])) & #stochastic cross
(dataframe['fastd_rsi'] < 20) & # Guard: Stoch below 20
(dataframe['fastk_rsi'] < 20) &
(dataframe['close'] < dataframe["kc_lowerband"]) &
(dataframe['adx'] > 25) &
(dataframe['plus_di'] > dataframe['minus_di']) &
(dataframe['volume'] > 0)
),
'buy'] = 1
return dataframe
def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
),
'sell'] = 1
return dataframe