07-09-2018, 07:11 PM
Gekko v0.6.1 and v0.6.2 made an awsome leap, despite the hard work Mike was still responsive to all our feedbacks...there is nothing to say but a BIG thank you!
I went into production with this version today also, with kraken, binance and hitbtc exchange. For those interested in hitbtc support on v0.6, I will release it soon - just waiting for the next live trade to perform well.
With Gekko in general I came accross one showstopper which can happen in a race condition with the live trader plugin enabled. I used postgres but think it will affect every db. What happened? When running against a new currency/asset pair in trading mode and a blank db, the following error comes up: DB error while reading mostRecentWindow.
This happens inside Reader.prototype.mostRecentWindow function where it tries to query the candle table. This happens when tradingAdvisor.js plugin is calling prepareHistoricalData(). Means, the trading advisor is querying the database before the db plugin was able to create the (blank) table or even db. Even worse, the app is exiting with a die() after this error happens and the db plugin has no chance to create the db/table.
Whenever you start Gekko again you will be unable to proceed with this showstopper. Best is probably a core change to async wait until the db plugin is finished. As quick and dirty workaround I added an async wait before calling the die() method. In this case the db plugin has enough time to finish the db. The next start (and all following) will run as expected without error.
The change in (reader.js) Reader.prototype.mostRecentWindow:
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
const waitNdie = async function() {
await sleep(1000);
return util.die('DB error while reading mostRecentWindow');
}
waitNdie();
instead of just calling return util.die('DB error while reading mostRecentWindow');
I went into production with this version today also, with kraken, binance and hitbtc exchange. For those interested in hitbtc support on v0.6, I will release it soon - just waiting for the next live trade to perform well.
With Gekko in general I came accross one showstopper which can happen in a race condition with the live trader plugin enabled. I used postgres but think it will affect every db. What happened? When running against a new currency/asset pair in trading mode and a blank db, the following error comes up: DB error while reading mostRecentWindow.
This happens inside Reader.prototype.mostRecentWindow function where it tries to query the candle table. This happens when tradingAdvisor.js plugin is calling prepareHistoricalData(). Means, the trading advisor is querying the database before the db plugin was able to create the (blank) table or even db. Even worse, the app is exiting with a die() after this error happens and the db plugin has no chance to create the db/table.
Whenever you start Gekko again you will be unable to proceed with this showstopper. Best is probably a core change to async wait until the db plugin is finished. As quick and dirty workaround I added an async wait before calling the die() method. In this case the db plugin has enough time to finish the db. The next start (and all following) will run as expected without error.
The change in (reader.js) Reader.prototype.mostRecentWindow:
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
const waitNdie = async function() {
await sleep(1000);
return util.die('DB error while reading mostRecentWindow');
}
waitNdie();
instead of just calling return util.die('DB error while reading mostRecentWindow');