Consolidate market_buy with buyy
Opened this issue · 0 comments
zillionare commented
currently backtesting/trader-server support two seperate API to place now buy orders, that is market_buy and buy. However, we could be able to merge them into one API, say, keep buy
only. and the signature of buy
would be:
def buy(security: str, shares: int, price: Optional[float]=None, order_time: Optional[datetime.date]=None, **kwargs)->Dict:
"""Place a buy order.
The order could be either a market buy entrust or a limit price buy entrust
Args:
security (str): 证券代码
shares: (int): 购买数量
price (float): 买入价格(限价), 如果price指定为None,将转换为市价买入。
volume (int): 买入股票数
Keyword Args:
limit_price (float): 市价买入时的最高限价
"""