mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
binance: set snapshot.Time to now()
This commit is contained in:
parent
7e5d25a7e0
commit
b3ef66dff4
|
@ -1356,8 +1356,7 @@ func (e *Exchange) QueryDepth(ctx context.Context, symbol string) (snapshot type
|
||||||
|
|
||||||
func convertDepth(symbol string, response *binanceapi.Depth) (snapshot types.SliceOrderBook, finalUpdateID int64, err error) {
|
func convertDepth(symbol string, response *binanceapi.Depth) (snapshot types.SliceOrderBook, finalUpdateID int64, err error) {
|
||||||
snapshot.Symbol = symbol
|
snapshot.Symbol = symbol
|
||||||
// empty time since the API does not provide time information.
|
snapshot.Time = time.Now()
|
||||||
snapshot.Time = time.Time{}
|
|
||||||
|
|
||||||
finalUpdateID = response.LastUpdateId
|
finalUpdateID = response.LastUpdateId
|
||||||
for _, entry := range response.Bids {
|
for _, entry := range response.Bids {
|
||||||
|
|
|
@ -136,7 +136,7 @@ func (b *SliceOrderBook) updateBids(pvs PriceVolumeSlice) {
|
||||||
func (b *SliceOrderBook) update(book SliceOrderBook) {
|
func (b *SliceOrderBook) update(book SliceOrderBook) {
|
||||||
b.updateBids(book.Bids)
|
b.updateBids(book.Bids)
|
||||||
b.updateAsks(book.Asks)
|
b.updateAsks(book.Asks)
|
||||||
b.lastUpdateTime = time.Now()
|
b.lastUpdateTime = defaultTime(book.Time, time.Now)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *SliceOrderBook) Reset() {
|
func (b *SliceOrderBook) Reset() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user