TEST SHORT
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
"0": 5
|
"0": 5
|
||||||
},
|
},
|
||||||
"stoploss": {
|
"stoploss": {
|
||||||
"stoploss": -1.0
|
"stoploss": -0.02
|
||||||
},
|
},
|
||||||
"trailing": {
|
"trailing": {
|
||||||
"trailing_stop": false,
|
"trailing_stop": false,
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ class EmptyShort(IStrategy):
|
|||||||
self.log_trade(
|
self.log_trade(
|
||||||
last_candle=last_candle,
|
last_candle=last_candle,
|
||||||
date=current_time,
|
date=current_time,
|
||||||
action=("🟩Buy" if allow_to_buy else "Canceled") + " " + str(minutes),
|
action=("🟩Buy") + " " + str(minutes),
|
||||||
pair=pair,
|
pair=pair,
|
||||||
rate=rate,
|
rate=rate,
|
||||||
dispo=dispo,
|
dispo=dispo,
|
||||||
@@ -471,7 +471,7 @@ class EmptyShort(IStrategy):
|
|||||||
self.log_trade(
|
self.log_trade(
|
||||||
last_candle=last_candle,
|
last_candle=last_candle,
|
||||||
date=current_time,
|
date=current_time,
|
||||||
action=("🟩Buy" if allow_to_buy else "Canceled") + " " + reason,
|
action=("Canceled") + " " + reason,
|
||||||
pair=pair,
|
pair=pair,
|
||||||
rate=rate,
|
rate=rate,
|
||||||
dispo=dispo,
|
dispo=dispo,
|
||||||
@@ -569,11 +569,11 @@ class EmptyShort(IStrategy):
|
|||||||
# self.pairs[pair]['force_sell'] = True
|
# self.pairs[pair]['force_sell'] = True
|
||||||
# return 'sma'
|
# return 'sma'
|
||||||
#
|
#
|
||||||
if current_profit > tp_price and \
|
# if current_profit > tp_price and \
|
||||||
(baisse > self.baisse.value and last_candle[f"close"] > last_candle[self.b30_indicateur.value]) \
|
# (baisse > self.baisse.value and last_candle[f"close"] > last_candle[self.b30_indicateur.value]) \
|
||||||
and last_candle['hapercent'] > 0:
|
# and last_candle['hapercent'] > 0:
|
||||||
self.pairs[pair]['force_sell'] = True
|
# self.pairs[pair]['force_sell'] = True
|
||||||
return 'B30Sht'
|
# return 'B30Sht'
|
||||||
|
|
||||||
return None
|
return None
|
||||||
# self.log_trade(
|
# self.log_trade(
|
||||||
@@ -840,10 +840,10 @@ class EmptyShort(IStrategy):
|
|||||||
dataframe = merge_informative_pair(dataframe, informative, self.timeframe, "1d", ffill=True)
|
dataframe = merge_informative_pair(dataframe, informative, self.timeframe, "1d", ffill=True)
|
||||||
# ######################################################################################################
|
# ######################################################################################################
|
||||||
|
|
||||||
range_min = dataframe[f"min12_1h"]
|
range_min = dataframe[f"min12_1d"]
|
||||||
range_max = dataframe[f"max48"]
|
range_max = dataframe[f"max12_1d"]
|
||||||
|
|
||||||
dataframe[f"range_pos"] = ((dataframe['mid'] - range_min) / (range_max)).rolling(5).mean()
|
dataframe[f"range_pos"] = ((dataframe['mid'] - range_min) / (range_max - range_min)) #.rolling(5).mean()
|
||||||
|
|
||||||
# dataframe['cross_sma60'] = qtpylib.crossed_below(dataframe[self.sell_sma_indicators.value], dataframe[self.sell_crossed_sma_indicators.value])
|
# dataframe['cross_sma60'] = qtpylib.crossed_below(dataframe[self.sell_sma_indicators.value], dataframe[self.sell_crossed_sma_indicators.value])
|
||||||
|
|
||||||
@@ -1039,14 +1039,16 @@ class EmptyShort(IStrategy):
|
|||||||
# ['enter_long', 'enter_tag']
|
# ['enter_long', 'enter_tag']
|
||||||
# ] = (1, 'Mid')
|
# ] = (1, 'Mid')
|
||||||
|
|
||||||
# dataframe.loc[
|
dataframe.loc[
|
||||||
# (
|
(
|
||||||
# # (qtpylib.crossed_above(dataframe['sma60'], dataframe['mid_regression_1h']))
|
# (qtpylib.crossed_above(dataframe['sma60'], dataframe['mid_regression_1h']))
|
||||||
# (dataframe['rsi_1h'] <= 30)
|
(dataframe['sma12_1h'] > dataframe['sma12_1h'].shift(61))
|
||||||
# & (dataframe['min_rsi_12_1h'] == dataframe['rsi_1h'])
|
& (dataframe['range_pos'] < 0.05)
|
||||||
# ),
|
& (dataframe['close'] < dataframe['close_1d'])
|
||||||
# ['enter_long', 'enter_tag']
|
& (dataframe['close'] < dataframe['close_1h'])
|
||||||
# ] = (1, 'long')
|
),
|
||||||
|
['enter_long', 'enter_tag']
|
||||||
|
] = (1, 'long')
|
||||||
|
|
||||||
dataframe.loc[
|
dataframe.loc[
|
||||||
(
|
(
|
||||||
@@ -1063,9 +1065,11 @@ class EmptyShort(IStrategy):
|
|||||||
# (dataframe['rsi_1h'] >= 65)
|
# (dataframe['rsi_1h'] >= 65)
|
||||||
# & (dataframe['max_rsi_12_1h'] == dataframe['rsi_1h'])
|
# & (dataframe['max_rsi_12_1h'] == dataframe['rsi_1h'])
|
||||||
# & (dataframe['hapercent'] < 0)
|
# & (dataframe['hapercent'] < 0)
|
||||||
# & (dataframe['sma60'] < dataframe['sma60'].shift(1))
|
#
|
||||||
(dataframe['sma12_1h'] < dataframe['sma12_1h'].shift(61))
|
(dataframe['sma12_1h'] < dataframe['sma12_1h'].shift(61))
|
||||||
|
& (dataframe['range_pos'] > 0.05)
|
||||||
& (dataframe['close'] > dataframe['close_1d'])
|
& (dataframe['close'] > dataframe['close_1d'])
|
||||||
|
& (dataframe['close'] > dataframe['close_1h'])
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
['enter_short', 'enter_tag']
|
['enter_short', 'enter_tag']
|
||||||
@@ -1141,17 +1145,19 @@ class EmptyShort(IStrategy):
|
|||||||
# if conditions:
|
# if conditions:
|
||||||
# dataframe.loc[reduce(lambda x, y: x & y, conditions), ['exit_long', 'exit_tag']] = (1, 'god')
|
# dataframe.loc[reduce(lambda x, y: x & y, conditions), ['exit_long', 'exit_tag']] = (1, 'god')
|
||||||
|
|
||||||
# dataframe.loc[
|
dataframe.loc[
|
||||||
# (
|
(
|
||||||
# # (qtpylib.crossed_above(
|
# (qtpylib.crossed_above(
|
||||||
# # dataframe['sma'],
|
# dataframe['sma'],
|
||||||
# # dataframe['mid_regression_1h'])
|
# dataframe['mid_regression_1h'])
|
||||||
# # )
|
# )
|
||||||
# (dataframe['rsi_1h'] >= 70)
|
(dataframe['sma12_1h'] < dataframe['sma12_1h'].shift(61))
|
||||||
# & (dataframe['max_rsi_12_1h'] == dataframe['rsi_1h'])
|
& (dataframe['range_pos'] > 0.01)
|
||||||
# ),
|
& (dataframe['close'] > dataframe['close_1d'])
|
||||||
# ['exit_long', 'exit_tag']
|
& (dataframe['close'] > dataframe['close_1h'])
|
||||||
# ] = (1, 'long')
|
),
|
||||||
|
['exit_long', 'exit_tag']
|
||||||
|
] = (1, 'long')
|
||||||
|
|
||||||
dataframe.loc[
|
dataframe.loc[
|
||||||
(
|
(
|
||||||
@@ -1159,10 +1165,17 @@ class EmptyShort(IStrategy):
|
|||||||
# dataframe['sma'],
|
# dataframe['sma'],
|
||||||
# dataframe['mid_regression_1h'])
|
# dataframe['mid_regression_1h'])
|
||||||
# )
|
# )
|
||||||
(dataframe['rsi_1h'] <= 30)
|
|
||||||
& (dataframe['min_rsi_12_1h'] == dataframe['rsi_1h'])
|
# (dataframe['rsi_1h'] <= 30)
|
||||||
& (dataframe['hapercent'] > 0)
|
# & (dataframe['min_rsi_12_1h'] == dataframe['rsi_1h'])
|
||||||
& (dataframe['sma60'] >= dataframe['sma60'].shift(1))
|
# & (dataframe['hapercent'] > 0)
|
||||||
|
# & (dataframe['sma60'] >= dataframe['sma60'].shift(1))
|
||||||
|
|
||||||
|
(dataframe['sma12_1h'] > dataframe['sma12_1h'].shift(61))
|
||||||
|
& (dataframe['range_pos'] < 0.01)
|
||||||
|
& (dataframe['close'] < dataframe['close_1d'])
|
||||||
|
& (dataframe['close'] < dataframe['close_1h'])
|
||||||
|
|
||||||
),
|
),
|
||||||
['exit_short', 'exit_tag']
|
['exit_short', 'exit_tag']
|
||||||
] = (1, 'short')
|
] = (1, 'short')
|
||||||
|
|||||||
Reference in New Issue
Block a user