mirror of
https://github.com/wassname/libcryptomarket.git
synced 2026-09-09 11:25:52 +08:00
Resolve UTC issue in candles
This commit is contained in:
@@ -64,3 +64,4 @@ target/
|
||||
# Others
|
||||
.editorconfig
|
||||
.github/
|
||||
.idea/
|
||||
|
||||
@@ -19,8 +19,8 @@ def candles(source, symbol, start_time, end_time, frequency):
|
||||
|
||||
data = source.public_get_returnchartdata(params={
|
||||
"currencyPair": symbol,
|
||||
"start": start_time.timestamp(),
|
||||
"end": end_time.timestamp(),
|
||||
"start": round(start_time.timestamp()),
|
||||
"end": round(end_time.timestamp()),
|
||||
"period": frequency
|
||||
})
|
||||
|
||||
@@ -31,7 +31,7 @@ def candles(source, symbol, start_time, end_time, frequency):
|
||||
})
|
||||
|
||||
data.loc[:, 'start_time'] = data['start_time'].apply(
|
||||
pd.Timestamp.fromtimestamp)
|
||||
lambda x : pd.Timestamp.fromtimestamp(x).tz_localize('UTC'))
|
||||
data['end_time'] = data['start_time'] + pd.DateOffset(
|
||||
seconds=frequency)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user