Skip to content

Commit

Permalink
resolve error when setting the frequency string in get_ohlc_data.
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiktraxl committed May 6, 2021
1 parent c1dde16 commit 7cd45b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pykrakenapi/pykrakenapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ def get_ohlc_data(self, pair, interval=1, since=None, ascending=False):
ohlc['dtime'] = pd.to_datetime(ohlc.time, unit='s')
ohlc.sort_values('dtime', ascending=ascending, inplace=True)
ohlc.set_index('dtime', inplace=True)
ohlc.index.freq = str(interval) + 'T'
freq = str(interval) + 'T' if ascending else str(-interval) + 'T'
ohlc.index.freq = freq

# dtypes
for col in ['open', 'high', 'low', 'close', 'vwap', 'volume']:
Expand Down Expand Up @@ -1896,7 +1897,7 @@ def add_standard_order(self, pair, type, ordertype, volume, price=None,
User reference id. 32-bit signed number.
validate : bool, optional (default=True)
Validate inputs only. Do not submit order (default).
Validate inputs only. Do not submit order (default).
optional closing order to add to system when order gets filled:
close[ordertype] = order type
Expand Down

0 comments on commit 7cd45b5

Please sign in to comment.