调整下单逻辑,避免超过涨跌停价位无法下单的情况。
This commit is contained in:
+5
-2
@@ -1,7 +1,10 @@
|
||||
from typing import Any
|
||||
|
||||
|
||||
import sfgrid_constants
|
||||
import xtquant.xtconstant as xtconstant
|
||||
from xtquant import xtdata, xttrader
|
||||
from xtquant.xttype import StockAccount, XtPosition
|
||||
from xtquant.xttype import StockAccount, XtOrder, XtPosition
|
||||
|
||||
import datetime
|
||||
def is_trading_time():
|
||||
@@ -58,7 +61,7 @@ def getStockPosition(stock_code: str, xt_trader: xttrader.XtQuantTrader, account
|
||||
def minPosition(gridIndex:int):
|
||||
return sfgrid_constants.grid_volume * gridIndex
|
||||
|
||||
def queryPendingOrder(stock_code:str, tag: str, xt_trader: xttrader.XtQuantTrader, account: StockAccount):
|
||||
def queryPendingOrder(stock_code:str, tag: str, xt_trader: xttrader.XtQuantTrader, account: StockAccount) -> list[XtOrder]:
|
||||
if stock_code == None or tag == None:
|
||||
return []
|
||||
orders = xt_trader.query_stock_orders(account)
|
||||
|
||||
Reference in New Issue
Block a user