2 Star 7 Fork 10

王布衣/engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
command_update.go 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
package command
import (
"fmt"
"gitee.com/quant1x/engine/cache"
"gitee.com/quant1x/engine/storages"
cmder "github.com/spf13/cobra"
)
// CmdUpdate 更新数据
var CmdUpdate = &cmder.Command{
Use: "update",
Example: Application + " update --all",
//Args: args.MinimumNArgs(0),
Args: func(cmd *cmder.Command, args []string) error {
return nil
},
Short: "更新股市数据",
Long: `更新股市数据`,
Run: func(cmd *cmder.Command, args []string) {
if flagAll.Value {
// 全部更新
handleUpdateAll()
} else if flagHistory.Value {
//handleUpdateAll()
}
},
}
func init() {
commandInit(CmdUpdate, &flagAll)
commandInit(CmdUpdate, &flagHistory)
}
func handleUpdateAll() {
fmt.Println()
currentDate := cache.DefaultCanUpdateDate()
cacheDate, featureDate := cache.CorrectDate(currentDate)
//storages.UpdateBaseCache(&barIndex, cacheDate, featureDate)
storages.UpdateBaseData(&barIndex, cacheDate, featureDate)
storages.UpdateFeature(&barIndex, cacheDate, featureDate)
_ = cacheDate
_ = featureDate
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quant1x/engine.git
git@gitee.com:quant1x/engine.git
quant1x
engine
engine
v0.1.6

搜索帮助