修复交易记录基数虚高:禁止币×价÷杠杆发明保证金,优先计划保证金/风险金额反推。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3901,6 +3901,14 @@ def margin_capital_for_trade_record(order_row):
|
||||
lev = order_row["leverage"]
|
||||
if "trigger_price" in keys:
|
||||
trigger = order_row["trigger_price"]
|
||||
stop = None
|
||||
risk = None
|
||||
if "initial_stop_loss" in keys:
|
||||
stop = order_row["initial_stop_loss"]
|
||||
if (stop is None or stop == "") and "stop_loss" in keys:
|
||||
stop = order_row["stop_loss"]
|
||||
if "risk_amount" in keys:
|
||||
risk = order_row["risk_amount"]
|
||||
return resolve_trade_record_margin_usdt(
|
||||
exchange_margin_usdt=_order_row_exchange_margin_usdt(order_row),
|
||||
plan_margin_capital=plan,
|
||||
@@ -3908,6 +3916,8 @@ def margin_capital_for_trade_record(order_row):
|
||||
notional_value=notional,
|
||||
leverage=lev,
|
||||
trigger_price=trigger,
|
||||
stop_loss=stop,
|
||||
risk_amount=risk,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user