双买交易行权价拆分为看涨行权价和看跌行权价,支持不同价位
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,8 @@ def dual_option_page(request: Request, db: Session = Depends(get_db)):
|
||||
def open_trade(
|
||||
request: Request,
|
||||
contract_code: str = Form(...),
|
||||
strike_price: float = Form(...),
|
||||
call_strike_price: float = Form(...),
|
||||
put_strike_price: float = Form(...),
|
||||
call_open_price: float = Form(...),
|
||||
put_open_price: float = Form(...),
|
||||
call_open_fee: float = Form(0.0),
|
||||
@@ -72,7 +73,8 @@ def open_trade(
|
||||
t = DualOptionTrade(
|
||||
product_code=product_code,
|
||||
contract_code=code,
|
||||
strike_price=strike_price,
|
||||
call_strike_price=call_strike_price,
|
||||
put_strike_price=put_strike_price,
|
||||
call_open_price=call_open_price,
|
||||
put_open_price=put_open_price,
|
||||
call_open_fee=call_open_fee,
|
||||
@@ -114,7 +116,8 @@ def edit_trade(
|
||||
request: Request,
|
||||
trade_id: int,
|
||||
contract_code: str = Form(...),
|
||||
strike_price: float = Form(...),
|
||||
call_strike_price: float = Form(...),
|
||||
put_strike_price: float = Form(...),
|
||||
call_open_price: float = Form(...),
|
||||
put_open_price: float = Form(...),
|
||||
call_open_fee: float = Form(0.0),
|
||||
@@ -138,7 +141,8 @@ def edit_trade(
|
||||
t.product_code = product.code if product else code[:2]
|
||||
t.point_value = product.point_value if product else 20
|
||||
t.contract_code = code
|
||||
t.strike_price = strike_price
|
||||
t.call_strike_price = call_strike_price
|
||||
t.put_strike_price = put_strike_price
|
||||
t.call_open_price = call_open_price
|
||||
t.put_open_price = put_open_price
|
||||
t.call_open_fee = call_open_fee
|
||||
|
||||
Reference in New Issue
Block a user