This commit is contained in:
2026-09-05 13:53:26 +08:00
parent 63ffc1329b
commit 58e1e3e291
7 changed files with 343 additions and 317 deletions

View File

@@ -8,7 +8,6 @@ from libs import calc_buy_volume
from sdk import OP_BUY
from .runtime import Runtime
from .order import PlaceOrderRequest
from .state import STATUS_ING, StateItem
import logging as log
@@ -88,16 +87,11 @@ def do_open(run: Runtime, code: str, volume: int, signal_key: str, price: float)
volume,
order_id,
signal_key,
kind="base",
)
if not run.orders.place(request):
raise RuntimeError("订单提交失败")
run.state.set(StateItem(
code=code,
base_order_id=order_id,
base_status=STATUS_ING,
))
run.state.save()
run.open_watch.forget(code)