2 Star 0 Fork 4

王布衣/exchange

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
exchange_limit.go 589 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2025-09-14 21:58 +08:00 . 更新依赖库版本
package exchange
import (
"gitee.com/quant1x/gox/api"
"gitee.com/quant1x/num"
)
// MarketLimit 涨跌停板限制
func MarketLimit(securityCode string) float64 {
_, flag, shortCode := DetectMarket(securityCode)
if flag == MarketBeiJing {
return 0.30
}
if api.StartsWith(shortCode, []string{"30", "68"}) {
return 0.20
}
return 0.10
}
// LimitUp 返回涨停板价格
func LimitUp(securityCode string, price float64) float64 {
limit := MarketLimit(securityCode)
lastClose := num.Decimal(price)
upStopPrice := num.Decimal(lastClose * (1.0000 + limit))
return upStopPrice
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/exchange.git
git@gitee.com:quant1x/exchange.git
quant1x
exchange
exchange
v0.8.11

搜索帮助