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

Counterparty offer #637

Merged
merged 10 commits into from
Jun 15, 2021
Merged

Counterparty offer #637

merged 10 commits into from
Jun 15, 2021

Conversation

mar-heaven
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Jun 8, 2021

Coverage Status

Coverage increased (+0.1%) to 65.042% when pulling c355286 on mar-heaven:counterparty_offer into 79699f4 on ricequant:develop.

rqalpha/mod/rqalpha_mod_sys_simulation/matcher.py Outdated Show resolved Hide resolved
rqalpha/mod/rqalpha_mod_sys_simulation/matcher.py Outdated Show resolved Hide resolved
rqalpha/mod/rqalpha_mod_sys_simulation/matcher.py Outdated Show resolved Hide resolved
rqalpha/mod/rqalpha_mod_sys_simulation/matcher.py Outdated Show resolved Hide resolved
rqalpha/mod/rqalpha_mod_sys_simulation/matcher.py Outdated Show resolved Hide resolved
"""
raise NotImplementedError

def get_ask_price(self, order_book_id):
Copy link
Contributor

Choose a reason for hiding this comment

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

get_ask_prices

def get_ask_vols(self, order_book_id):
# type: (str) -> list
"""
获取合约的1-5档卖方交易量
Copy link
Contributor

Choose a reason for hiding this comment

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

获取合约的多档卖方申报量

def get_ask_price(self, order_book_id):
# type: (str) -> list
"""
获取合约的1-5档卖价
Copy link
Contributor

@Cuizi7 Cuizi7 Jun 11, 2021

Choose a reason for hiding this comment

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

获取合约的多档卖方申报价

rqalpha/mod/rqalpha_mod_sys_simulation/matcher.py Outdated Show resolved Hide resolved
rqalpha/mod/rqalpha_mod_sys_simulation/matcher.py Outdated Show resolved Hide resolved
rqalpha/mod/rqalpha_mod_sys_simulation/matcher.py Outdated Show resolved Hide resolved
@@ -257,6 +258,15 @@ def frozen_price(self):
raise RuntimeError("Frozen price of order {} is not supposed to be nan.".format(self.order_id))
return self._frozen_price

@property
def frozen_cash(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

订单状态变动的时候 frozen_cash 也需要更新

else:
self._frozen_cash -= self._frozen_cash_of_order(event.order)
self._frozen_cash -= order.frozen_cash
Copy link
Contributor

Choose a reason for hiding this comment

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

下文 apply_trade 中也有解冻资金的逻辑

Copy link
Contributor

Choose a reason for hiding this comment

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

也需要做对应改动

@Cuizi7 Cuizi7 merged commit 5ce13b9 into ricequant:develop Jun 15, 2021
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.

3 participants