feat(web-ui): 三处回测入口默认起始日期统一为 2020-01-06

单标的回测、组合回测、参数寻优原默认起始日为「3 年前」(动态滚动),
统一改为固定日期 2020-01-06,便于跨时间横向对比。结束日仍为今天。
SymbolPicker 共用组件的 defineModel 默认值同步更新。
This commit is contained in:
Justin Gu
2026-07-05 00:15:00 +08:00
parent 64d0812257
commit 66c49d1a8d
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
// 选标的 + 配置日期范围(取行情由父组件在「开始回测/开始寻优」时触发)。
// 市场按 6 位代码智能识别,不再手动选择。
// 后端 /bars 仅支持 count(上限 800,约 3.2 年),固定拉满后前端按日期过滤。
// 默认:结束日=今天(最近交易日),开始日=3年前
// 默认:结束日=今天(最近交易日),开始日=2020-01-06
import { computed, ref } from 'vue'
@@ -24,7 +24,7 @@ const store = useBacktestStore()
const code = defineModel<string>('code', { default: '000001' })
const category = defineModel<Category>('category', { default: 'DAY' })
const startDate = defineModel<string>('startDate', {
default: new Date(Date.now() - 365 * 3 * 86400_000).toISOString().slice(0, 10),
default: '2020-01-06',
})
const endDate = defineModel<string>('endDate', {
default: new Date().toISOString().slice(0, 10),
+1 -1
View File
@@ -31,7 +31,7 @@ function isoDaysFromNow(days: number): string {
d.setDate(d.getDate() + days)
return d.toISOString().slice(0, 10)
}
const startDate = ref(isoDaysFromNow(-365 * 3))
const startDate = ref('2020-01-06')
const endDate = ref(isoDaysFromNow(0))
// 表单状态(v-model 给子组件)
+1 -1
View File
@@ -27,7 +27,7 @@ function isoDaysFromNow(days: number): string {
d.setDate(d.getDate() + days)
return d.toISOString().slice(0, 10)
}
const startDate = ref(isoDaysFromNow(-365 * 3))
const startDate = ref('2020-01-06')
const endDate = ref(isoDaysFromNow(0))
const strategy = ref('ma_cross')
+1 -1
View File
@@ -36,7 +36,7 @@ function isoDaysFromNow(days: number): string {
d.setDate(d.getDate() + days)
return d.toISOString().slice(0, 10)
}
const startDate = ref(isoDaysFromNow(-365 * 3))
const startDate = ref('2020-01-06')
const endDate = ref(isoDaysFromNow(0))
onMounted(async () => {