mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 14:34:15 +08:00
feat(web-ui): 三处回测入口默认起始日期统一为 2020-01-06
单标的回测、组合回测、参数寻优原默认起始日为「3 年前」(动态滚动), 统一改为固定日期 2020-01-06,便于跨时间横向对比。结束日仍为今天。 SymbolPicker 共用组件的 defineModel 默认值同步更新。
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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 给子组件)
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user