You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
782 B
27 lines
782 B
package trading |
|
|
|
import ( |
|
"sig-pub/api/pb" |
|
vmts "sig-pub/pkg/storage/tsdb/victoria_metrics" |
|
"sig-pub/pkg/types" |
|
"sig-pub/pkg/utils/collect" |
|
) |
|
|
|
type KlineStore struct { |
|
vmdb vmts.VictoriaMetricsTSDB |
|
store [3]*collect.ConcurrentMap[string, collect.ConcurrentMap[types.Interval, *KlineSeries]] // K线列表: []exchange<instId, interval, klines> |
|
} |
|
|
|
func NewKlineSeriesStore(vmdb vmts.VictoriaMetricsTSDB) (kss *KlineStore) { |
|
kss = &KlineStore{ |
|
vmdb: vmdb, |
|
} |
|
kss.store[pb.ExchangeType_OKX] = collect.NewConcurrentMap[string, collect.ConcurrentMap[types.Interval, *KlineSeries]](64, func(s string) string { return s }) |
|
// kss.klines[pb.ExchangeType_BINANCE] = |
|
return |
|
} |
|
|
|
func (s *KlineStore) Update(exchange pb.ExchangeType, kline *types.Kline) (k types.Kline) { |
|
|
|
return |
|
}
|
|
|