1、合约止盈止损单在减仓单成交之后再取消
This commit is contained in:
@ -250,15 +250,20 @@ func handleTickerMessage(msg []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
//行情存储时间
|
||||
lastUtc := utcTime - 1000*60*60
|
||||
val, _ := helper.DefaultRedis.GetAllList(rediskey.CacheSymbolLastPrice)
|
||||
|
||||
if _, err := helper.DefaultRedis.RemoveBeforeScore(lastPriceKey, float64(lastUtc)); err != nil {
|
||||
log.Errorf("移除 现货交易对:%s %d之前的最新成交价失败,err:%v", symbolName, lastUtc, err)
|
||||
}
|
||||
if utility.ContainsStr(val, symbolName) {
|
||||
//行情存储时间
|
||||
lastUtc := utcTime - 1000*60*60
|
||||
content := fmt.Sprintf("%d:%s", utcTime, lastPrice.String())
|
||||
|
||||
if err := helper.DefaultRedis.AddSortSet(lastPriceKey, float64(utcTime), lastPrice.String()); err != nil {
|
||||
log.Errorf("添加 现货交易对:%s %d之前的最新成交价失败,err:%v", symbolName, lastUtc, err)
|
||||
if _, err := helper.DefaultRedis.RemoveBeforeScore(lastPriceKey, float64(lastUtc)); err != nil {
|
||||
log.Errorf("移除 现货交易对:%s %d之前的最新成交价失败,err:%v", symbolName, lastUtc, err)
|
||||
}
|
||||
|
||||
if err := helper.DefaultRedis.AddSortSet(lastPriceKey, float64(utcTime), content); err != nil {
|
||||
log.Errorf("添加 现货交易对:%s %d之前的最新成交价失败,err:%v", symbolName, lastUtc, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user