2 Star 4 Fork 10

王布衣/engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config_data.go 3.15 KB
一键复制 编辑 原始数据 按行查看 历史
package config
import "gitee.com/quant1x/exchange"
const (
DefaultMinimumConcurrencyForSnapshots = 2 // 快照默认最小并发数
)
// DataParameter 数据源参数
type DataParameter struct {
BackTesting BackTestingParameter `name:"回测" yaml:"backtesting"` // 回测参数
Trans HistoricalTradingDataParameter `name:"历史成交数据" yaml:"trans"` // 历史成交参数
Feature FeatureParameter `name:"特征" yaml:"feature"` // 特征参数
Snapshot SnapshotParameter `name:"快照" yaml:"snapshot"` // 快照参数
}
// GetDataConfig 取得数据配置
func GetDataConfig() DataParameter {
dataParameter := GlobalConfig.Data
backTestingParameter := dataParameter.BackTesting
backTestingParameter.TargetIndex = exchange.CorrectSecurityCode(backTestingParameter.TargetIndex)
return dataParameter
}
// BackTestingParameter 回测参数
type BackTestingParameter struct {
TargetIndex string `name:"参考指数" yaml:"target_index" default:"sh000001"` // 阿尔法和贝塔的参考指数, 默认是上证指数
NextPremiumRate float64 `name:"隔日溢价率" yaml:"next_premium_rate" default:"0.03"` // 隔日溢价率百分比
}
// HistoricalTradingDataParameter 历史成交数据参数
type HistoricalTradingDataParameter struct {
BeginDate string `name:"默认开始日期" yaml:"begin_date" default:"2023-10-01"`
}
// FeatureParameter 特征参数
type FeatureParameter struct {
F10 FeatureF10 `name:"F10" yaml:"f10"` // F10的参数
Tendency int `name:"趋势类型" yaml:"tendency" default:"0"` // 策略是趋势主导还是股价主导, 默认是0, 0-股价主导,1-趋势主导,2-股价或趋势
Wave FeatureWave `name:"波浪" yaml:"wave"` // 波浪
CrossStarRatio float64 `name:"十字星实体占比" yaml:"cross_star_ratio" default:"0.50"` // 判断十字星, K线实体(OPEN-CLOSE)在K线长度(HIGH-LOW)中的占比
}
// FeatureF10 F10特征数据参数
type FeatureF10 struct {
ReportingRiskPeriod int `name:"财报预警周期" yaml:"reporting_risk_period" default:"3"` // 预警距离财务报告日期还有多少个交易日, 默认3个交易日
}
// FeatureWave 特征 - 波浪
type FeatureWave struct {
Fields FeatureWaveFields `name:"波浪检测字段" yaml:"fields"` // K线检测字段
Periods int `name:"周期数" yaml:"periods" default:"89"` // 波浪检测K线周期数, 默认89天
ReferencePeriods int `name:"均线参照周期" yaml:"reference_periods" default:"5"` // 趋势转变参考均线的周期数, 默认是5日均线
}
// FeatureWaveFields 波浪的数据字段
type FeatureWaveFields struct {
Peak string `yaml:"peak" default:"close"` // K线检测 - 波峰字段, 默认是收盘价
Valley string `yaml:"valley" default:"close"` // K线检测 - 波谷字段, 默认是收盘价
}
// SnapshotParameter 快照参数
type SnapshotParameter struct {
Concurrency int `name:"并发数" yaml:"concurrency" default:"0"` // 并发数, 默认是0, 使用服务器数量的半数
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quant1x/engine.git
git@gitee.com:quant1x/engine.git
quant1x
engine
engine
v1.8.32

搜索帮助

Cb406eda 1850385 E526c682 1850385