Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
pair="{}/{}".format(asset.upper(), stake.upper()),
interval=interval,
open=row[1],
close=row[4],
high=row[2],
low=row[3],
volume=row[5],
timestamp=row[0]
)
OHLCV.session.merge(o)
# return all data to user
result = []
# filter by exchange, currency and other pairs
for row in OHLCV.session.query(OHLCV).filter(
OHLCV.exchange == ccxt_api.name,
OHLCV.pair == "{}/{}".format(asset.upper(), stake.upper()),
OHLCV.interval == interval,
OHLCV.timestamp >= from_date * 1000,
OHLCV.timestamp <= till_date * 1000,
).all():
result.append([row.timestamp, row.open, row.high, row.low, row.close, row.volume])
return result