2 Star 14 Fork 16

王布衣/engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
command_update.go 882 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2023-10-01 17:49 +08:00 . 增加第一个策略执行的demo
package command
import (
"fmt"
"gitee.com/quant1x/engine/cachel5"
"gitee.com/quant1x/engine/storages"
flags "github.com/spf13/cobra"
)
// CmdUpdate 更新数据
var CmdUpdate = &flags.Command{
Use: "update",
Example: Application + " update --all",
//Args: args.MinimumNArgs(0),
Args: func(cmd *flags.Command, args []string) error {
return nil
},
Short: "更新股市数据",
Long: `更新股市数据`,
Run: func(cmd *flags.Command, args []string) {
if flagHistory.Value {
handleUpdateAll()
}
},
}
func init() {
flagHistory.init(CmdUpdate)
}
func handleUpdateAll() {
fmt.Println()
currentDate := cachel5.DefaultCanUpdateDate()
cacheDate, featureDate := cachel5.CorrectDate(currentDate)
//storages.UpdateBaseCache(&barIndex, cacheDate, featureDate)
storages.UpdateBaseData(&barIndex, cacheDate, featureDate)
_ = cacheDate
_ = featureDate
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quant1x/engine.git
git@gitee.com:quant1x/engine.git
quant1x
engine
engine
v0.1.1

搜索帮助