We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have used the below code to fetch ohlcv data def fetch_ohlcv(self, symbol, resolution, num_bars): endpoint = '/v2/history/candles' end_timestamp = int(datetime.datetime.now().timestamp()) start_timestamp = end_timestamp - (num_bars * self.resolution_to_seconds(resolution)) params = { 'symbol': symbol, 'resolution': resolution, 'start': start_timestamp, 'end': end_timestamp } try: response = self.request(method="GET",path=endpoint,query=params) response.raise_for_status() # Raise an exception for 4xx or 5xx status codes return response.json() except requests.exceptions.RequestException as err: print(f"Error: {err}") return None
def fetch_ohlcv(self, symbol, resolution, num_bars): endpoint = '/v2/history/candles' end_timestamp = int(datetime.datetime.now().timestamp()) start_timestamp = end_timestamp - (num_bars * self.resolution_to_seconds(resolution)) params = { 'symbol': symbol, 'resolution': resolution, 'start': start_timestamp, 'end': end_timestamp } try: response = self.request(method="GET",path=endpoint,query=params) response.raise_for_status() # Raise an exception for 4xx or 5xx status codes return response.json() except requests.exceptions.RequestException as err: print(f"Error: {err}") return None
But the result i get is the same number for all the columns and rows
close high low open time volume
0 34522.5 34522.5 34522.5 34522.5 2023-11-30 00:00:00 1000 1 34522.5 34522.5 34522.5 34522.5 2023-11-29 20:00:00 0 2 34522.5 34522.5 34522.5 34522.5 2023-11-29 16:00:00 0 3 34522.5 34522.5 34522.5 34522.5 2023-11-29 12:00:00 0 4 34522.5 34522.5 34522.5 34522.5 2023-11-29 08:00:00 0 .. ... ... ... ... ... ... 62 34521.0 34521.0 34521.0 34521.0 2023-11-19 16:00:00 10000 63 34521.0 34521.0 34521.0 34521.0 2023-11-19 12:00:00 0 64 34521.0 34521.0 34521.0 34521.0 2023-11-19 08:00:00 1000 65 34521.0 34521.0 34521.0 34521.0 2023-11-19 04:00:00 0 66 34521.0 34521.0 34521.0 34521.0 2023-11-19 00:00:00 17619
all values are almost same is the api not working????
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have used the below code to fetch ohlcv data
def fetch_ohlcv(self, symbol, resolution, num_bars): endpoint = '/v2/history/candles' end_timestamp = int(datetime.datetime.now().timestamp()) start_timestamp = end_timestamp - (num_bars * self.resolution_to_seconds(resolution)) params = { 'symbol': symbol, 'resolution': resolution, 'start': start_timestamp, 'end': end_timestamp } try: response = self.request(method="GET",path=endpoint,query=params) response.raise_for_status() # Raise an exception for 4xx or 5xx status codes return response.json() except requests.exceptions.RequestException as err: print(f"Error: {err}") return None
But the result i get is the same number for all the columns and rows
0 34522.5 34522.5 34522.5 34522.5 2023-11-30 00:00:00 1000
1 34522.5 34522.5 34522.5 34522.5 2023-11-29 20:00:00 0
2 34522.5 34522.5 34522.5 34522.5 2023-11-29 16:00:00 0
3 34522.5 34522.5 34522.5 34522.5 2023-11-29 12:00:00 0
4 34522.5 34522.5 34522.5 34522.5 2023-11-29 08:00:00 0
.. ... ... ... ... ... ...
62 34521.0 34521.0 34521.0 34521.0 2023-11-19 16:00:00 10000
63 34521.0 34521.0 34521.0 34521.0 2023-11-19 12:00:00 0
64 34521.0 34521.0 34521.0 34521.0 2023-11-19 08:00:00 1000
65 34521.0 34521.0 34521.0 34521.0 2023-11-19 04:00:00 0
66 34521.0 34521.0 34521.0 34521.0 2023-11-19 00:00:00 17619
all values are almost same is the api not working????
The text was updated successfully, but these errors were encountered: