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

Dev quant 1480 #733

Merged
merged 3 commits into from Sep 2, 2022
Merged

Dev quant 1480 #733

merged 3 commits into from Sep 2, 2022

Conversation

Zhou-JiaJun
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Sep 2, 2022

Coverage Status

Coverage decreased (-0.009%) to 63.868% when pulling 8351796 on dev-quant-1480 into 22af07e on develop.

@@ -228,7 +229,7 @@ def contract_multiplier(self):
@property
@lru_cache()
Copy link
Contributor

Choose a reason for hiding this comment

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

顺手把这里的 property 改成 utils 中的 cached_property 吧

if not is_valid_price(self._prev_close):
env = Environment.get_instance()
self._prev_close = env.data_proxy.get_prev_close(self._order_book_id, env.trading_dt)
if not is_valid_price(self._prev_close) or self._cur_trading_date is None or self._cur_trading_date < self._env.trading_dt.date():
Copy link
Contributor

Choose a reason for hiding this comment

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

这太复杂了,而且每次取 prev_close 做这么多判断性能也比较差,直接在 before_trading 中把 self._prev_close 清理掉吧

@Cuizi7 Cuizi7 merged commit 8b73713 into develop Sep 2, 2022
@Zhou-JiaJun Zhou-JiaJun deleted the dev-quant-1480 branch September 2, 2022 15:24
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