固定六个交易品种并修正 1/5/9 月合约轮换规则
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,9 @@ from typing import Optional
|
||||
# exchange: tushare 合约后缀(交易所)
|
||||
# active: 当月 -> (主力合约月, 年份偏移)
|
||||
# 例 FG 12 月用次年 5 月,故 12 -> (5, 1)
|
||||
# 允许前端选择的品种列表
|
||||
SYMBOLS = ["FG", "SA", "RB", "MA", "CF", "M"]
|
||||
|
||||
ROLLOVER_RULES: dict[str, dict] = {
|
||||
"FG": {
|
||||
"exchange": "ZCE",
|
||||
@@ -16,6 +19,46 @@ ROLLOVER_RULES: dict[str, dict] = {
|
||||
12: (5, 1),
|
||||
},
|
||||
},
|
||||
"SA": {
|
||||
"exchange": "ZCE",
|
||||
"active": {
|
||||
1: (5, 0), 2: (5, 0), 3: (5, 0), 4: (5, 0),
|
||||
5: (9, 0), 6: (9, 0), 7: (9, 0), 8: (9, 0),
|
||||
9: (1, 1), 10: (1, 1), 11: (1, 1), 12: (1, 1),
|
||||
},
|
||||
},
|
||||
"MA": {
|
||||
"exchange": "ZCE",
|
||||
"active": {
|
||||
1: (5, 0), 2: (5, 0), 3: (5, 0), 4: (5, 0),
|
||||
5: (9, 0), 6: (9, 0), 7: (9, 0), 8: (9, 0),
|
||||
9: (1, 1), 10: (1, 1), 11: (1, 1), 12: (1, 1),
|
||||
},
|
||||
},
|
||||
"CF": {
|
||||
"exchange": "ZCE",
|
||||
"active": {
|
||||
1: (5, 0), 2: (5, 0), 3: (5, 0), 4: (5, 0),
|
||||
5: (9, 0), 6: (9, 0), 7: (9, 0), 8: (9, 0),
|
||||
9: (1, 1), 10: (1, 1), 11: (1, 1), 12: (1, 1),
|
||||
},
|
||||
},
|
||||
"RB": {
|
||||
"exchange": "SHF",
|
||||
"active": {
|
||||
1: (10, 0), 2: (10, 0), 3: (10, 0), 4: (10, 0), 5: (10, 0),
|
||||
6: (1, 1), 7: (1, 1), 8: (1, 1), 9: (1, 1),
|
||||
10: (5, 1), 11: (5, 1), 12: (5, 1),
|
||||
},
|
||||
},
|
||||
"M": {
|
||||
"exchange": "DCE",
|
||||
"active": {
|
||||
1: (5, 0), 2: (5, 0), 3: (5, 0), 4: (5, 0), 5: (5, 0),
|
||||
6: (9, 0), 7: (9, 0), 8: (9, 0),
|
||||
9: (1, 1), 10: (1, 1), 11: (1, 1), 12: (1, 1),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import { ElMessage } from 'element-plus'
|
||||
import { listContracts } from '@/api/scores'
|
||||
import { runPipeline, type RunResponse } from '@/api/run'
|
||||
|
||||
const SYMBOLS = ['FG', 'SA', 'RB', 'MA', 'CF', 'M']
|
||||
|
||||
const form = reactive<{
|
||||
ts_code: string
|
||||
symbol: string
|
||||
@@ -83,12 +85,10 @@ onMounted(async () => {
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="品种代号">
|
||||
<el-input
|
||||
v-model="form.symbol"
|
||||
placeholder="未选合约时按此品种选主力,如 FG"
|
||||
clearable
|
||||
/>
|
||||
<el-form-item label="品种">
|
||||
<el-select v-model="form.symbol" style="width: 100%">
|
||||
<el-option v-for="s in SYMBOLS" :key="s" :label="s" :value="s" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="打分日期">
|
||||
<el-date-picker
|
||||
|
||||
Reference in New Issue
Block a user