From afc78e158c766aa8288e3db24b32ddc2986e2470 Mon Sep 17 00:00:00 2001 From: Hemant Tekwani Date: Tue, 5 Sep 2023 19:25:58 +0530 Subject: [PATCH] add section param to candles fetch function call --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index ed3e102..d03dc6e 100644 --- a/index.js +++ b/index.js @@ -18,6 +18,7 @@ const { calcRealizedPositionPnl, calcUnrealizedPositionPnl } = require('bfx-hf-s const EventEmitter = require('events') const CANDLE_FETCH_LIMIT = 1000 +const CANDLE_FETCH_SECTION = 'hist' const pt = new PromiseThrottle({ requestsPerSecond: 10.0 / 60.0, // taken from docs promiseImplementation: Promise @@ -193,6 +194,7 @@ class LiveStrategyExecution extends EventEmitter { const candles = await this._fetchCandles({ symbol, timeframe, + section: CANDLE_FETCH_SECTION, query: { start: start - (120 * 1000), // 2 min threshold end, @@ -238,6 +240,7 @@ class LiveStrategyExecution extends EventEmitter { const candles = await this._fetchCandles({ symbol, timeframe, + section: CANDLE_FETCH_SECTION, query: { limit: CANDLE_FETCH_LIMIT, start,