2 Star 8 Fork 11

王布衣/engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
cache
cache.go
cache_code.go
cache_code_test.go
cache_filename.go
cache_filepath.go
cache_others.go
cache_test.go
cache_trader.go
data.go
data_action.go
data_adapter.go
data_adapter_test.go
data_increase.go
data_summary.go
datetime.go
datetime_test.go
scoreboard.go
command
config
datasource
docs
factors
labs
market
models
permissions
realtime
rules
services
storages
strategies
tools
tracker
trader
utils
.gitignore
CHANGELOG.md
LICENSE
README.md
go.mod
go.sum
main.go
publish-compile.sh
publish-linux-amd64.sh
publish-mac-amd64.sh
publish-mac-arm64.sh
publish-windows-amd64.sh
publish-windows-arm64.sh
publish-windows.ps1
publish-windows.py
克隆/下载
cache_trader.go 969 Bytes
一键复制 编辑 原始数据 按行查看 历史
package cache
import (
"fmt"
"gitee.com/quant1x/engine/config"
"gitee.com/quant1x/gox/api"
"strings"
"sync"
)
const (
keyOrdersPath = "qmt" // QMT订单缓存路径
)
var (
qmtOnce sync.Once
qmtOrderPath = "" // QMT订单路径
)
// QMT默认路径
func defaultQmtCachePath() string {
path := fmt.Sprintf("%s/%s", GetRootPath(), keyOrdersPath)
return path
}
func lazyInitQmt() {
traderParameter := &config.GlobalConfig.Trader
traderParameter.OrderPath = strings.TrimSpace(traderParameter.OrderPath)
if len(traderParameter.OrderPath) > 0 && api.CheckFilepath(traderParameter.OrderPath, true) == nil {
// 如果配置了路径且有效
qmtOrderPath = traderParameter.OrderPath
} else {
qmtOrderPath = defaultQmtCachePath()
}
traderParameter.OrderPath = qmtOrderPath
}
func initMiniQmt() {
qmtOnce.Do(lazyInitQmt)
}
// GetQmtCachePath QMT订单文件路径
func GetQmtCachePath() string {
qmtOnce.Do(lazyInitQmt)
return qmtOrderPath
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quant1x/engine.git
git@gitee.com:quant1x/engine.git
quant1x
engine
engine
v1.8.42

搜索帮助

371d5123 14472233 46e8bd33 14472233