fix bug
This commit is contained in:
@@ -15,15 +15,20 @@ class TradeMixin:
|
||||
def passorder(
|
||||
self,
|
||||
op_type: int,
|
||||
stock_code: str,
|
||||
volume: int,
|
||||
stock_code: str = "",
|
||||
volume: int = 0,
|
||||
order_type: int = ORDER_TYPE_VOLUME,
|
||||
pr_type: int = PR_TYPE_LATEST,
|
||||
price: float = -1,
|
||||
quick_trade: int = QUICK_TRADE_NOW,
|
||||
strategy_name: str = "",
|
||||
order_id: str = "",
|
||||
stock: str = "",
|
||||
) -> dict[str, Any]:
|
||||
# ``stock`` is retained for compatibility with the original IPO client.
|
||||
stock_code = str(stock_code or stock).strip()
|
||||
if not stock_code:
|
||||
raise ValueError("stock_code cannot be empty")
|
||||
return self._post_json(
|
||||
"/api/trade/passorder",
|
||||
{
|
||||
@@ -39,6 +44,14 @@ class TradeMixin:
|
||||
},
|
||||
)
|
||||
|
||||
def ipo_data(self, ipo_type: str = "STOCK") -> list[dict[str, Any]]:
|
||||
"""Return today's IPO candidates from the QMT REST service."""
|
||||
response = self._post_json(
|
||||
"/api/trade/ipo_data",
|
||||
{"type": str(ipo_type).strip().upper()},
|
||||
) or []
|
||||
return response if isinstance(response, list) else []
|
||||
|
||||
def passorder_latest(self, side: int, stock_code: str, volume: int) -> dict[str, Any]:
|
||||
return self.passorder(side, stock_code, volume)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user