fix开仓价卖回价与真盈亏一次冻结,复盘同步不再反复改写。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -520,6 +520,14 @@ def open_coin_option_buy_full(
|
||||
message="期权持仓中",
|
||||
)
|
||||
|
||||
# 开仓价一次冻结:优先买币 VWAP(之后不再改);权利金币量 premium_paid 固定
|
||||
open_px_freeze = idx_open
|
||||
try:
|
||||
bv = _spot_bridge.bridge_buy_vwap(conn, bridge_id)
|
||||
if bv is not None and float(bv) > 0:
|
||||
open_px_freeze = float(bv)
|
||||
except Exception:
|
||||
pass
|
||||
trade_id = _insert_coin_trade(
|
||||
conn,
|
||||
inst_id=inst_id,
|
||||
@@ -537,7 +545,7 @@ def open_coin_option_buy_full(
|
||||
budget_usdt=buy_usdt,
|
||||
premium_ccy=premium_ccy,
|
||||
open_fee=open_fee,
|
||||
open_index_px=idx_open,
|
||||
open_index_px=open_px_freeze,
|
||||
trading_usdt_before=trading_usdt_before,
|
||||
profit_exit_enabled=profit_exit_enabled,
|
||||
profit_exit_mult=profit_exit_mult,
|
||||
|
||||
Reference in New Issue
Block a user