Skip to content

Commit

Permalink
bitmex fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur Cetinkol committed Feb 6, 2022
1 parent cd68abc commit d35341b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tradingfeatures/apis/bitmex/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ def get(self,
if return_r:
return r

df = pd.read_json(r.content)
df = pd.DataFrame.from_dict(r.json())
if len(df) == 0:
return None
df['timestamp'] = self.to_ts(df['timestamp'])
df['timestamp'] = self.to_ts(pd.to_datetime(df['timestamp']))
df.pop('symbol')
df = df.set_index('timestamp')
df.index = df.index.astype(int)
Expand All @@ -96,6 +96,6 @@ def _start_check(self, address, symbol):
address = self.base_address + address
querry = {'symbol': self.symbol_check(symbol), 'binSize': '1h', 'reverse': 'false'}
r = self.response_handler(address, params=querry)
df = pd.read_json(r.content)
df['timestamp'] = self.to_ts(df['timestamp'])
self.start =df['timestamp'][0]
df = pd.DataFrame.from_dict(r.json())
df['timestamp'] = self.to_ts(pd.to_datetime(df['timestamp']))
self.start = df['timestamp'][0]

0 comments on commit d35341b

Please sign in to comment.