chore: restore codebase to state before 2026-08-11 changes

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-11 12:48:01 +08:00
parent f086f57c91
commit bccf704aac
34 changed files with 405 additions and 1392 deletions
+2 -19
View File
@@ -55,7 +55,6 @@ def build_options_open_message(
premium_paid: Any = None,
open_quote: Any = None,
target_index: Any = None,
profit_rr: Any = None,
signal_note: str = "",
trade_id: Any = None,
) -> str:
@@ -74,12 +73,7 @@ def build_options_open_message(
f"权利金:{_fmt(premium_paid)} USDC",
]
)
if profit_rr is not None and str(profit_rr).strip() != "":
try:
lines.append(f"盈亏比:×{float(profit_rr):g}(达标全平;不达标等到期)")
except (TypeError, ValueError):
lines.append(f"盈亏比:{profit_rr}")
elif target_index is not None and str(target_index).strip() != "":
if target_index is not None and str(target_index).strip() != "":
try:
lines.append(f"目标指数:{float(target_index):g}")
except (TypeError, ValueError):
@@ -102,7 +96,6 @@ def build_options_close_message(
realized_pnl: Any = None,
close_quote: Any = None,
target_index: Any = None,
profit_rr: Any = None,
trigger_idx: Any = None,
trade_id: Any = None,
) -> str:
@@ -123,12 +116,7 @@ def build_options_close_message(
f"实现盈亏:{_fmt(realized_pnl, 4)} USDC",
]
)
if profit_rr is not None and str(profit_rr).strip() != "":
try:
lines.append(f"盈亏比:×{float(profit_rr):g}")
except (TypeError, ValueError):
lines.append(f"盈亏比:{profit_rr}")
elif target_index is not None and str(target_index).strip() != "":
if target_index is not None and str(target_index).strip() != "":
try:
lines.append(f"目标指数:{float(target_index):g}")
except (TypeError, ValueError):
@@ -153,7 +141,6 @@ def notify_options_open(
premium_paid: Any = None,
open_quote: Any = None,
target_index: Any = None,
profit_rr: Any = None,
signal_note: str = "",
) -> bool:
ensure_options_notify_columns(conn) if conn is not None else None
@@ -173,7 +160,6 @@ def notify_options_open(
premium_paid=premium_paid,
open_quote=open_quote,
target_index=target_index,
profit_rr=profit_rr,
signal_note=signal_note,
trade_id=trade_id,
)
@@ -210,7 +196,6 @@ def notify_options_close(
realized_pnl: Any = None,
close_quote: Any = None,
target_index: Any = None,
profit_rr: Any = None,
trigger_idx: Any = None,
force: bool = False,
) -> bool:
@@ -272,7 +257,6 @@ def notify_options_close(
realized_pnl=total_pnl,
close_quote=close_quote if close_quote is not None else head.get("close_quote"),
target_index=target_index,
profit_rr=profit_rr,
trigger_idx=trigger_idx,
trade_id=head.get("id") if len(rows) == 1 else None,
)
@@ -302,7 +286,6 @@ def notify_options_close(
realized_pnl=realized_pnl,
close_quote=close_quote,
target_index=target_index,
profit_rr=profit_rr,
trigger_idx=trigger_idx,
trade_id=trade_id,
)