Skip to content

revise limit price valid logic - #931

Merged
Cuizi7 merged 4 commits into
developfrom
RQSDK-803
Aug 5, 2025
Merged

revise limit price valid logic#931
Cuizi7 merged 4 commits into
developfrom
RQSDK-803

Conversation

@Lin-Dongzhao

Copy link
Copy Markdown
Collaborator

修改了涨跌停价格的判断逻辑,另外的测试用例改动原因为:

  1. test_f_mean_reverting.pkl 改动是因为测试用例使用的标的 commission 发生了变化
  2. tests/api_tests/test_position_queue.py 测试用例由于所使用的标的交易参数发生变化,导致资金不足,因此调整策略账户资金

LIMIT_PRICE_VALID_THRESHOLD = 1e-7


def _is_limit_price_valid(order_book_id: str, side: SIDE, deal_price: float, price_board: AbstractPriceBoard):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

函数名不合理。


def _is_limit_price_valid(order_book_id: str, side: SIDE, deal_price: float, price_board: AbstractPriceBoard):
if side == SIDE.BUY:
return math.isclose(deal_price, price_board.get_limit_up(order_book_id), abs_tol=LIMIT_PRICE_VALID_THRESHOLD)

Copy link
Copy Markdown
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 53cbf4b into develop Aug 5, 2025
14 checks passed
@Lin-Dongzhao
Lin-Dongzhao deleted the RQSDK-803 branch July 15, 2026 03:19
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