日志展示优化
This commit is contained in:
@@ -727,8 +727,8 @@ class BitmartFuturesTransaction:
|
||||
retrace_close_threshold = long_levels["close_threshold"]
|
||||
min_gain_price_long = long_levels["open"] * (1 + self.take_profit_min_gain_pct_from_entry / 100)
|
||||
min_gain_ok_long = long_levels["extreme"] > min_gain_price_long
|
||||
# 使用当前K线 high 判定是否已触发到 4/4 极值,避免依赖分钟收盘价漏判
|
||||
if long_levels["extreme"] > long_levels["open"]:
|
||||
# 止盈启动前提:当前K线相对开盘价涨幅已超过 0.4%,才标记为已触发
|
||||
if long_levels["extreme"] >= long_levels["open"] * (1 + self.take_profit_min_gain_pct_from_entry / 100):
|
||||
self.take_profit_triggered_kline_id = current_kline_time
|
||||
if (
|
||||
self.take_profit_triggered_kline_id == current_kline_time
|
||||
@@ -781,8 +781,8 @@ class BitmartFuturesTransaction:
|
||||
retrace_close_threshold_short = short_levels["close_threshold"]
|
||||
min_gain_price_short = short_levels["open"] * (1 - self.take_profit_min_gain_pct_from_entry / 100)
|
||||
min_gain_ok_short = short_levels["extreme"] < min_gain_price_short
|
||||
# 使用当前K线 low 判定是否已触发到 4/4 极值,避免依赖分钟收盘价漏判
|
||||
if short_levels["extreme"] < short_levels["open"]:
|
||||
# 止盈启动前提:当前K线相对开盘价跌幅已超过 0.4%,才标记为已触发
|
||||
if short_levels["extreme"] <= short_levels["open"] * (1 - self.take_profit_min_gain_pct_from_entry / 100):
|
||||
self.take_profit_triggered_kline_id_short = current_kline_time
|
||||
if (
|
||||
self.take_profit_triggered_kline_id_short == current_kline_time
|
||||
@@ -804,11 +804,11 @@ class BitmartFuturesTransaction:
|
||||
signal = self.check_signal(current_price, prev_kline, current_kline)
|
||||
else:
|
||||
signal = self.check_signal(current_price, prev_kline, current_kline)
|
||||
# 3.8 止盈平空后:价格继续反弹并突破 2/4 才同向开空
|
||||
# 3.8 止盈平空后:价格回落并低于 2/4 才同向开空
|
||||
elif self.start == 0 and self.take_profit_reentry_threshold_short is not None:
|
||||
if current_price > self.take_profit_reentry_threshold_short:
|
||||
if current_price < self.take_profit_reentry_threshold_short:
|
||||
reason = (
|
||||
f"止盈平空后价格继续反弹并突破{self.take_profit_reentry_threshold_short:.2f}(2/4),按规则同向开空"
|
||||
f"止盈平空后价格回落并低于{self.take_profit_reentry_threshold_short:.2f}(2/4),按规则同向开空"
|
||||
)
|
||||
self._log_take_profit_action("止盈后同向开空", reason)
|
||||
self.开单(marketPriceLongOrder=-1, size=self.default_order_size)
|
||||
|
||||
Reference in New Issue
Block a user