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

仅在交易时段内撮合 #804

Merged
merged 3 commits into from Jul 26, 2023
Merged

仅在交易时段内撮合 #804

merged 3 commits into from Jul 26, 2023

Conversation

Zhou-JiaJun
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Jul 26, 2023

Coverage Status

coverage: 64.885% (+1.4%) from 63.472% when pulling 69bbaf2 on RQSDK-671 into 8f9aaf1 on develop.

Copy link
Contributor

@Cuizi7 Cuizi7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试也要加上

@@ -166,8 +166,16 @@ def on_tick(self, event):
self._match(tick.order_book_id)

def _match(self, order_book_id=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里可以直接传入一个时间,避免从 env 重复取。

@@ -375,6 +375,13 @@ def trading_hours(self):
trading_period.append(TimeRange(start, end))
return trading_period

def during_continuous_auction(self, dt):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参数类型改成 datetime.time

@@ -166,8 +166,16 @@ def on_tick(self, event):
self._match(tick.order_book_id)

def _match(self, order_book_id=None):
order_filter = lambda a_and_o: not (a_and_o[1].is_final() or (order_book_id and a_and_o[1].order_book_id != order_book_id))
for account, order in filter(order_filter, self._open_orders):
order_filter = lambda a_and_o: all([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

合并两个 filter,然后用 and 连起来而不是 all(利用短路逻辑提升性能)。

@Zhou-JiaJun Zhou-JiaJun merged commit ceaaa3c into develop Jul 26, 2023
7 of 13 checks passed
@Zhou-JiaJun Zhou-JiaJun deleted the RQSDK-671 branch July 26, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants