mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 09:18:08 +00:00
commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
- [Binance Fetch Ohlcv Closing Time 1](./examples/py/)
|
||||
|
||||
|
||||
```python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import ccxt # noqa: E402
|
||||
|
||||
|
||||
exchange = ccxt.binance()
|
||||
symbol = 'BTC/USDT'
|
||||
timeframe = '1h'
|
||||
|
||||
timeframe_duration_in_seconds = exchange.parse_timeframe(timeframe)
|
||||
timeframe_duration_in_milliseconds = timeframe_duration_in_seconds * 1000
|
||||
ohlcvs = exchange.fetch_ohlcv(symbol, timeframe)
|
||||
for ohlcv in ohlcvs:
|
||||
print([exchange.iso8601(ohlcv[0] + timeframe_duration_in_milliseconds - 1)] + ohlcv[1:])
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user