Split fee stats by leg and hide LIVE slip.
SIM shows perp/option fees and slip separately; LIVE keeps real exchange fees only with slip forced to zero. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -570,7 +570,7 @@ class OkxLiveExecutor(Matcher):
|
||||
of_px = float(prev["fill_px"])
|
||||
of_fee = float(prev["fee"] or 0)
|
||||
of_notional = float(prev["notional"] or (of_px * opt_qty))
|
||||
of_slip = float(prev["slip"] or 0)
|
||||
of_slip = 0.0 # LIVE 不计模拟滑点
|
||||
else:
|
||||
# 含到期:优先交易所真实平期权;失败且无内在价值时可本地结算
|
||||
try:
|
||||
@@ -593,12 +593,12 @@ class OkxLiveExecutor(Matcher):
|
||||
of = option_expiry_settle(
|
||||
intrinsic=float(intrinsic), qty_eth=opt_qty, fee_rate=fee_rate
|
||||
)
|
||||
of_px, of_fee, of_slip, of_notional = (
|
||||
of_px, of_fee, of_notional = (
|
||||
of.fill_px,
|
||||
of.fee,
|
||||
of.slip,
|
||||
of.notional,
|
||||
)
|
||||
of_slip = 0.0 # LIVE 不计模拟滑点
|
||||
logger.warning(
|
||||
"expiry option exchange close failed, local settle: %s", e
|
||||
)
|
||||
@@ -779,9 +779,9 @@ class OkxLiveExecutor(Matcher):
|
||||
g = self.db.fetchone("SELECT * FROM groups WHERE group_id=?", (group_id,))
|
||||
base_fees = float((g["fees"] if g else 0) or 0)
|
||||
fees = base_fees + (0.0 if skip_option_cash else of_fee) + pf_fee
|
||||
slip = float((g["slip_cost"] if g else 0) or 0) + (
|
||||
0.0 if option_fill_already_written else of_slip
|
||||
)
|
||||
# LIVE:真实成交价已含盘口冲击,不另计/不计模拟滑点
|
||||
of_slip = 0.0
|
||||
slip = 0.0
|
||||
from ..sim.pnl import summarize_fills_pnl
|
||||
|
||||
with self.db._lock:
|
||||
|
||||
Reference in New Issue
Block a user