mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 14:34:18 +08:00
fix: fetchBars 停页判断取末根(最新根)恒假,带 startDate 的请求多翻一页
页内升序,本页最早一根应是 pageBars[0];原代码取 pageBars[length-1] (=最新根),"最早 ≤ startDate" 恒假 → 每个限定日期范围的请求都多发 一页 800 根(sentiment 量能仪表盘 2 页→1 页,选股器/弹窗同样受益)。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
+4
-2
@@ -113,9 +113,11 @@ export async function fetchBars(
|
|||||||
|
|
||||||
allBars = allBars.concat(pageBars)
|
allBars = allBars.concat(pageBars)
|
||||||
|
|
||||||
// 若已覆盖到 startDate(本页最早一根 ≤ startDate),停止翻页
|
// 若已覆盖到 startDate(本页最早一根 ≤ startDate),停止翻页。
|
||||||
|
// 页内升序:首根才是本页最早(此前取末根=最新根,判断恒假,每个带
|
||||||
|
// startDate 的请求都多翻一页)
|
||||||
if (startDate && pageBars.length > 0) {
|
if (startDate && pageBars.length > 0) {
|
||||||
const oldest = pageBars[pageBars.length - 1].datetime.slice(0, 10)
|
const oldest = pageBars[0].datetime.slice(0, 10)
|
||||||
if (oldest <= startDate) break
|
if (oldest <= startDate) break
|
||||||
}
|
}
|
||||||
// 不足 800 根说明已到数据起点
|
// 不足 800 根说明已到数据起点
|
||||||
|
|||||||
Reference in New Issue
Block a user