fix: label trend breakeven handoff as 趋势回调 across four exchanges
Set order monitor and trade record source to trend pullback after handoff; unify hub and instance display; add migration script for legacy rows. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -50,8 +50,10 @@ from fib_key_monitor_lib import (
|
||||
)
|
||||
from strategy_trade_labels import (
|
||||
STRATEGY_ENTRY_REASON_OPTIONS,
|
||||
apply_order_monitor_source_labels,
|
||||
entry_reason_for_monitor_type,
|
||||
handoff_trade_miss_reason,
|
||||
order_monitor_source_type,
|
||||
trade_record_monitor_type as resolve_trade_record_monitor_type,
|
||||
trend_plan_id_from_monitor_row,
|
||||
)
|
||||
@@ -2282,9 +2284,7 @@ def enrich_order_item(raw_item, current_capital):
|
||||
item["breakeven_enabled"] = 0 if be is not None and int(be) == 0 else 1
|
||||
except Exception:
|
||||
item["breakeven_enabled"] = 1
|
||||
if not (item.get("monitor_type") or "").strip():
|
||||
item["monitor_type"] = ORDER_MONITOR_TYPE_MANUAL
|
||||
return item
|
||||
return apply_order_monitor_source_labels(item, default_manual=ORDER_MONITOR_TYPE_MANUAL)
|
||||
|
||||
|
||||
def ensure_exchange_live_ready():
|
||||
@@ -2296,17 +2296,7 @@ def ensure_exchange_live_ready():
|
||||
|
||||
|
||||
def order_row_monitor_type(row):
|
||||
if row is None:
|
||||
return ORDER_MONITOR_TYPE_MANUAL
|
||||
try:
|
||||
keys = row.keys() if hasattr(row, "keys") else []
|
||||
except Exception:
|
||||
keys = []
|
||||
if "monitor_type" in keys:
|
||||
mt = (row["monitor_type"] or "").strip()
|
||||
if mt:
|
||||
return mt
|
||||
return ORDER_MONITOR_TYPE_MANUAL
|
||||
return order_monitor_source_type(row, default_manual=ORDER_MONITOR_TYPE_MANUAL)
|
||||
|
||||
|
||||
def trade_record_monitor_type(conn, row):
|
||||
|
||||
Reference in New Issue
Block a user