mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 08:15:15 +00:00
binance: avoid using fromId and timeRange at the same time
This commit is contained in:
parent
ae678d1b3b
commit
6c0cc71c1c
|
@ -1506,19 +1506,19 @@ func (e *Exchange) querySpotTrades(ctx context.Context, symbol string, options *
|
||||||
// BINANCE uses inclusive last trade ID
|
// BINANCE uses inclusive last trade ID
|
||||||
if options.LastTradeID > 0 {
|
if options.LastTradeID > 0 {
|
||||||
req.FromID(options.LastTradeID)
|
req.FromID(options.LastTradeID)
|
||||||
}
|
} else {
|
||||||
|
if options.StartTime != nil && options.EndTime != nil {
|
||||||
if options.StartTime != nil && options.EndTime != nil {
|
if options.EndTime.Sub(*options.StartTime) < 24*time.Hour {
|
||||||
if options.EndTime.Sub(*options.StartTime) < 24*time.Hour {
|
req.StartTime(*options.StartTime)
|
||||||
|
req.EndTime(*options.EndTime)
|
||||||
|
} else {
|
||||||
|
req.StartTime(*options.StartTime)
|
||||||
|
}
|
||||||
|
} else if options.StartTime != nil {
|
||||||
req.StartTime(*options.StartTime)
|
req.StartTime(*options.StartTime)
|
||||||
|
} else if options.EndTime != nil {
|
||||||
req.EndTime(*options.EndTime)
|
req.EndTime(*options.EndTime)
|
||||||
} else {
|
|
||||||
req.StartTime(*options.StartTime)
|
|
||||||
}
|
}
|
||||||
} else if options.StartTime != nil {
|
|
||||||
req.StartTime(*options.StartTime)
|
|
||||||
} else if options.EndTime != nil {
|
|
||||||
req.EndTime(*options.EndTime)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.Limit > 0 {
|
if options.Limit > 0 {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user