Created
April 26, 2022 10:49
-
-
Save SmartManoj/5c4e0566c899bf213ffe0d66bd4ed433 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ccxt | |
from datetime import datetime | |
from pprint import pprint | |
connection = ccxt.gateio() | |
pair = 'FITFI/USDT' | |
timestamp = int(datetime.strptime( | |
"2022-04-26 10:30:00+00:00", "%Y-%m-%d %H:%M:%S%z").timestamp()) | |
timeframe = '1m' | |
timeframe = '10s' | |
response = connection.fetch_ohlcv(pair, timeframe, None, 2, | |
params={'to': timestamp}) | |
pprint([datetime.utcfromtimestamp(response[-1][0] / 1000).isoformat(), *response[-1][1:]]) | |
pprint([datetime.utcfromtimestamp(response[0][0] / 1000).isoformat(), *response[0][1:]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment