From 500e662f35d1413ff5f14468bc3f4b6ba1364c08 Mon Sep 17 00:00:00 2001 From: Jacob Plaster Date: Fri, 11 Jan 2019 14:38:09 +0000 Subject: [PATCH] BfxRest: add ability to specify timeframe when seeding candles --- bfxapi/rest/BfxRest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bfxapi/rest/BfxRest.py b/bfxapi/rest/BfxRest.py index e74ae22..129abf8 100644 --- a/bfxapi/rest/BfxRest.py +++ b/bfxapi/rest/BfxRest.py @@ -67,11 +67,11 @@ class BfxRest: # Public Data # ################################################## - async def get_seed_candles(self, symbol): + async def get_seed_candles(self, symbol, tf='1m'): """ Used by the honey framework, this function gets the last 4k candles. """ - endpoint = 'candles/trade:1m:{}/hist?limit=5000&_bfx=1'.format(symbol) + endpoint = 'candles/trade:{}:{}/hist?limit=5000&_bfx=1'.format(tf, symbol) time_difference = (1000 * 60) * 5000 # get now to the nearest min now = int(round((time.time() // 60 * 60) * 1000))