添加新的检测
This commit is contained in:
@@ -50,7 +50,7 @@ class ChanLun_BTC_30(IStrategy):
|
||||
"240": 0
|
||||
}
|
||||
# 15m and 30m
|
||||
minimal_roi = {
|
||||
minimal_roi_1 = {
|
||||
"0": 0.1,
|
||||
"240": 0.05,
|
||||
"480": 0.03,
|
||||
@@ -64,7 +64,7 @@ class ChanLun_BTC_30(IStrategy):
|
||||
}
|
||||
|
||||
can_short = True
|
||||
lev = 2.5
|
||||
lev = 2.0
|
||||
stoploss = -0.3 # 设置为很大的负值,让custom_stoploss来控制
|
||||
use_custom_stoploss = True # 启用自定义止损
|
||||
|
||||
@@ -265,7 +265,14 @@ class ChanLun_BTC_30(IStrategy):
|
||||
else:
|
||||
# 最保守的回退:5%
|
||||
return -0.05
|
||||
|
||||
dataframe, _ = self.dp.get_analyzed_dataframe(trade.pair, self.timeframe)
|
||||
last_candle = dataframe.iloc[-1].squeeze()
|
||||
ema52_str = 'resample_{}_ema52'.format(self.get_ticker_indicator()*self.time60)
|
||||
ema52_val = float(last_candle.get(ema52_str, 0) or 0)
|
||||
close_str = 'resample_{}_close'.format(self.get_ticker_indicator()*self.time60)
|
||||
close_val = float(last_candle.get(close_str, 0) or 0)
|
||||
if close_val < ema52_val:
|
||||
return -0.01
|
||||
if trade.is_short:
|
||||
stop_price = trade.open_rate + float(entry_atr)
|
||||
else:
|
||||
@@ -325,12 +332,12 @@ class ChanLun_BTC_30(IStrategy):
|
||||
state30 = 'resample_{}_state'.format(self.get_ticker_indicator()*shift30)
|
||||
dataframe.loc[
|
||||
(
|
||||
(dataframe[state30].shift(shift30) == "-20")
|
||||
(dataframe[state60].shift(shift60) == "-20")
|
||||
),
|
||||
['enter_long', 'enter_tag']] = (1, 'long_30')
|
||||
dataframe.loc[
|
||||
(
|
||||
(dataframe[state30].shift(shift30) == "20")
|
||||
(dataframe[state30].shift(shift30) == "40")
|
||||
),
|
||||
['enter_short', 'enter_tag']] = (1, 'short_30')
|
||||
return dataframe
|
||||
@@ -341,8 +348,8 @@ class ChanLun_BTC_30(IStrategy):
|
||||
state30 = 'resample_{}_state'.format(self.get_ticker_indicator()*shift30)
|
||||
dataframe.loc[
|
||||
(
|
||||
(dataframe[state30].shift(shift30) == "20") |
|
||||
(dataframe[state30].shift(shift30) == "30")
|
||||
(dataframe[state60].shift(shift60) == "20") |
|
||||
(dataframe[state60].shift(shift60) == "30")
|
||||
),
|
||||
['exit_long', 'exit_tag']] = (1, 'long_close_30')
|
||||
dataframe.loc[
|
||||
|
||||
Reference in New Issue
Block a user