Add some check now
This commit is contained in:
@@ -55,19 +55,19 @@ class ChanLun_BTC_30(IStrategy):
|
||||
"480": 0.03,
|
||||
"600": 0
|
||||
}
|
||||
minimal_roi_2 = {
|
||||
minimal_roi_1 = {
|
||||
"0": 0.10,
|
||||
"1200": 0.05,
|
||||
"2400": 0.025,
|
||||
"3600": 0
|
||||
}
|
||||
can_short = True
|
||||
lev = 2.0
|
||||
lev = 1.0
|
||||
stoploss = -0.3
|
||||
trailing_stop = True
|
||||
trailing_stop = False
|
||||
trailing_stop_positive = 0.025
|
||||
trailing_stop_positive_offset = 0.045
|
||||
trailing_only_offset_is_reached = True
|
||||
trailing_only_offset_is_reached = False
|
||||
|
||||
position_adjustment_enable = True
|
||||
startup_candle_count = 600
|
||||
@@ -198,12 +198,12 @@ class ChanLun_BTC_30(IStrategy):
|
||||
if trade.is_short:
|
||||
last_high = trade.get_custom_data(key="entry_candle_high")
|
||||
if current_rate > last_high:
|
||||
print(trade.open_date, last_high, current_rate, "Relay Top FX exit")
|
||||
#print(trade.open_date, last_high, current_rate, "Relay Top FX exit")
|
||||
return "Relay Top FX exit"
|
||||
else:
|
||||
last_low = trade.get_custom_data(key="entry_candle_low")
|
||||
if current_rate < last_low:
|
||||
print(trade.open_date, last_low, current_rate, "Relay Bottom FX exit")
|
||||
#print(trade.open_date, last_low, current_rate, "Relay Bottom FX exit")
|
||||
return "Relay Bottom FX exit"
|
||||
def order_filled(self, pair: str, trade: Trade, order: Order, current_time: datetime, **kwargs) -> None:
|
||||
"""
|
||||
@@ -228,7 +228,7 @@ class ChanLun_BTC_30(IStrategy):
|
||||
else:
|
||||
if (trade.nr_of_successful_entries == 1) and (order.ft_order_side == trade.entry_side):
|
||||
trade.set_custom_data(key="entry_candle_low", value=last_low)
|
||||
print(trade.open_date, trade.close_date, last_high, last_low, order.ft_order_side, klc_list[-2].start_time, klc_list[-2].end_time)
|
||||
#print(trade.open_date, trade.close_date, last_high, last_low, order.ft_order_side, klc_list[-2].start_time, klc_list[-2].end_time)
|
||||
self.last_trade = trade
|
||||
return None
|
||||
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||
|
||||
Reference in New Issue
Block a user