go-binance
go-binance copied to clipboard
how to get specific time price
is there a way to get spesific time price?
@aligurelli can you add more context to your question?
We would like to get the price of any PAIR at a specific timestamp.
In short, how we can get the price of the BNBBUSD at this timestamp : 1619692794756
symbol := "BNBUSDT"
ts := int64(1619692794756)
trades,_ := client.NewAggTradesService().
Symbol(symbol).
StartTime(ts).EndTime(ts + time.Hour.Milliseconds()).
Do(context.Background())
price := trades[0].Price
fmt.Println(price)