07-18-2018, 11:46 AM
Quote:Note that I don't want CCXT to be a dependency of Gekko (broker).
Yes, any of the three new exchange implementations (HitBTC, HuobiPro, OKEX) do not need any core changes. It is just adding the js file to the own gekko exchange installation folder - like any plugin/exchange. Under the hood they use CCXT but they do not necessarily be maintained inside your main development branch, if you do not want to.
Quote:Quote: Coinmarketcap is very quick for fetching data. However, it has some limitations. The candle size for a long term history period is 15 minutes. Benefit is, you get it all at once. If the daterange is <=24h, Coimarketcap returns 5 Min. candles, but you can of course loop the day fetching.
Dealing with 5 or 15 minute candles is going to be very bothersome for Gekko: Gekko stores 1 minute candles. If users use any candle size that's not modulus 5 or 15 they are not running strats over actual market data but a weird averaged candle (that includes nasty things like lookahead bias).
I proceeded implementing and testing this. For HuobiPro and OKEX I made coinmarketcap the default importer - because there is no data from the exchange. This way it works like any other --import, without new command line switches or core changes. It catches single days from cmc as necessary for the given import range and returns 5 min. candles. After looping and expanding them to one minute candles, they are emitted for processing and db writing. After this, the db stores 1 minute candles like any other import does. For most of my backtest scenarios this works fine. Even the limitations, it helps at least to backtest certain altcoins only supported by these exchanges, e.g. Cortex CTXT/USDT on HuobiPro.
Instead of using the fetch ticker, I implemented requests with async/await - data gets fetched from coinmarketcap pretty fast, most times 2 complete days of history data within 1 second.
New exchanges can be found here: https://github.com/mark-sch/gekko/tree/d...e/wrappers (and in the exchanges import folder)