Skip to content

Commit

Permalink
python pep8 edits
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jun 5, 2018
1 parent c94c846 commit 98801f9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/py/normalize-sparse-candle-timestamps.py
Expand Up @@ -2,29 +2,28 @@

import os
import sys
import datetime
from pprint import pprint

root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')

import ccxt # noqa: E402

exchange = ccxt.cryptopia({ 'enableRateLimit': True })
exchange = ccxt.cryptopia({'enableRateLimit': True})

symbol = 'ETH/BTC'
timeframe = '1h'

candles = exchange.fetch_ohlcv(symbol, timeframe)

# timeframe duration in seconds
duration = exchange.parse_timeframe (timeframe)
duration = exchange.parse_timeframe(timeframe)

# timeframe duration in milliseconds
duration *= 1000

pprint([[
exchange.iso8601 (int(round(candle[0] / duration)) * duration),
exchange.iso8601(int(round(candle[0] / duration)) * duration),
candle[1], # o
candle[2], # h
candle[3], # l
Expand Down

0 comments on commit 98801f9

Please sign in to comment.