[Bug] 涨跌幅超过 10% 时,涨幅榜和跌幅榜仍应按实际幅度排序

Open Beginner friendly
#236 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
87/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, typescript

Research direction

Start with the scoring logic in packages/shared/src/screening/strategies.ts and the sorting and limit handling in packages/shared/src/screening/service.ts. Run the two named test files, then add cases for the supplied gainers and losers quotes with both input orders. Done means limit: 1 returns +25% and −25%, scores remain in the 0–1 range, and other strategies keep their sorting behavior.

Written by the indexing model from the issue text.

Description

bug help wanted

用模拟行情给 AAPL.US、MSFT.US 分别设置 +11%、+25%,按这个顺序传给 ScreeningService.runScreening。策略用 top-gainers,只取一条结果,当前榜首是 +11% 的 AAPL.US。改用 top-losers 并传入 −11%、−25%,榜首同样选中了幅度较小的 −11%。

把 limit 调到 2,可以看到两条候选的 score 都是 1。服务按分数排序后直接截取结果。两种策略的评分 · 排序和截取

验收标准

  • 用以上两组模拟报价,limit: 1 分别返回 +25% 和 −25%。对调证券输入顺序也得到同一个榜首。
  • 保留候选评分的 0–1 范围,以及其他筛选策略已有的排序含义。
  • 可用 { persist: false } 直接测筛选服务,运行 bun test packages/shared/src/screening/service.test.ts packages/shared/src/screening/strategies.test.ts。

欢迎熟悉 TypeScript 或喜欢数据排序的朋友评论 /claim,整个复现只需两条假报价。

Dominant language
TypeScript
Stars
206
Forks
37
Avg merge
1d 1h
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ydflow/Trail

All issues in ydflow/Trail

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.