[Question] Why does gekko synthesize candle from trades by itself.
#1
Instead of using APIs like fetch_ohlcv from exchange interfaces?

Synthesized candle works fine in realtime trader, speed is OK there, but it becomes an issue when backtesting with imported history data. I tried to import half a year's data from bitfinex and it took a whole night to complete. I guess it'll be slower if the rate limit is low for an exchange.

Could anyone explain what advantage it has to use synthesized candle from trades?
  Reply
#2
Quote:Synthesized candle works fine in realtime trader, speed is OK there, but it becomes an issue when backtesting with imported history data. I tried to import half a year's data from bitfinex and it took a whole night to complete. I guess it'll be slower if the rate limit is low for an exchange.

Yes, the slow part is the API requests to fetch all trades, Gekko can consolidate millions of trades into candles pretty fast.

There are 2 major reasons for this:

- When the importer was written no big exchanges had API endpoints to fetch candles: this was years ago (when binance didn't exist yet for example). I want to rewrite the importer to take advantage of these kind of endpoints, but it's not at the top of my list (very much open for pull requests).
- Gekko candles include more than OHCL: they also include VWP, amount of trades and volume. The last one is also used by some strategies. So if you use an endpoint that doesn't include these metrics some strategies stop working, etc.
  Reply
#3
OK, I understand. One problem is if the import takes too long looks like Gekko has a difficult time to stitch historical data with live data together if I start a trading bot.

The 2ed reason is very important for a framework. Actually I didn't know it's possible to write strategies with VWP, thank you for the answer!
  Reply


Forum Jump:


Users browsing this thread: