first commit

This commit is contained in:
Francois Klieber committed 2021-06-06 20:25:14 +02:00
commit aa7869eb33
386 files changed
+69375

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
// simple POST request that returns the backtest result
const _ = require('lodash');
const promisify = require('tiny-promisify');
const pipelineRunner = promisify(require('../../core/workers/pipeline/parent'));
// starts a backtest
// requires a post body like:
//
// {
// gekkoConfig: {watch: {exchange: "poloniex", currency: "USDT", asset: "BTC"},…},…}
// data: {
// candleProps: ["close", "start"],
// indicatorResults: true,
// report: true,
// roundtrips: true
// }
// }
module.exports = function *() {
var mode = 'backtest';
var config = {};
var base = require('./baseConfig');
var req = this.request.body;
_.merge(config, base, req);
this.body = yield pipelineRunner(mode, config);
}