Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

order_to()返回 [[]] #754

Open
quant2008 opened this issue Jan 11, 2023 · 4 comments
Open

order_to()返回 [[]] #754

quant2008 opened this issue Jan 11, 2023 · 4 comments
Labels

Comments

@quant2008
Copy link

请问,有时执行下单命令order_to,返回的是[[]],啥场景下会返回这个?

@Cuizi7
Copy link
Contributor

Cuizi7 commented Jan 16, 2023

订单创建失败时返回空列表,如没通过风控等。

@Cuizi7 Cuizi7 closed this as completed Jan 16, 2023
@quant2008
Copy link
Author

我看到创建订单失败,经常返回 [None]。请问返回 [[]] 和 [None]的场景是不是不一样?分别是什么场景?

@Cuizi7
Copy link
Contributor

Cuizi7 commented Jan 16, 2023

应当统一返回空列表。返回 [None] 不是预期内的行为,可否描述一下是如何触发的,或者提供一段可复现的代码。

@Cuizi7 Cuizi7 reopened this Jan 16, 2023
@Cuizi7 Cuizi7 added the bug label Jan 16, 2023
@quant2008
Copy link
Author

quant2008 commented Jan 16, 2023

就是当已经持有1手多仓时,像如下那样下单,就会返回[None]。如下代码做日线回测,第一次成交后,后续就会出这个问题。

def open_auction(context, bar_dict):    
    o = order_to(“RB2305”, 1)
    print('order', o)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants