diff --git a/commands/train.js b/commands/train.js deleted file mode 100644 index 8585314fab..0000000000 --- a/commands/train.js +++ /dev/null @@ -1,409 +0,0 @@ -var tb = require('timebucket') - , minimist = require('minimist') - , fs = require('fs') - , path = require('path') - , spawn = require('child_process').spawn - , moment = require('moment') - // eslint-disable-next-line no-unused-vars - , colors = require('colors') - , analytics = require('forex.analytics') - , ProgressBar = require('progress') - , crypto = require('crypto') - , objectifySelector = require('../lib/objectify-selector') - , engineFactory = require('../lib/engine') - , collectionService = require('../lib/services/collection-service') - -var fa_defaultIndicators = [ - 'CCI', - 'MACD', - 'RSI', - 'SAR', - 'Stochastic' -] - -var fa_availableIndicators = [ - 'ATR', - 'BOP', - 'CCI', - 'MACD', - 'MACD_Signal', - 'MACD_Histogram', - 'Momentum', - 'RSI', - 'SAR', - 'SMA15_SMA50', - 'Stochastic' -] - - -function fa_getTrainOptions (so) { - if (typeof(so) === 'undefined') so = {} - - return { - populationCount: so.populationCount || 100, - generationCount: so.generationCount || 100, - selectionAmount: so.selectionAmount || 10, - leafValueMutationProbability: so.leafValueMutationProbability || 0.5, - leafSignMutationProbability: so.leafSignMutationProbability || 0.3, - logicalNodeMutationProbability: so.logicalNodeMutationProbability || 0.3, - leafIndicatorMutationProbability: so.leafIndicatorMutationProbability || 0.2, - crossoverProbability: so.crossoverProbability || 0.03, - indicators: so.indicators ? so.indicators.split(',') : fa_defaultIndicators - } -} - -module.exports = function (program, conf) { - program - .command('train [selector]') - .allowUnknownOption() - .description('Train the binary buy/sell decision tree for the forex.analytics strategy') - .option('--conf ', 'path to optional conf overrides file') - .option('--period ', 'period length of a candlestick (default: 30m)', String, '30m') - .option('--start_training ', 'start training at timestamp') - .option('--end_training ', 'end training at timestamp') - .option('--days_training ', 'set duration of training dataset by day count', Number, conf.days) - .option('--days_test ', 'set duration of test dataset to use with simulation, appended AFTER the training dataset (default: 0)', Number) - .option('--populationCount ', 'population count within one generation (default: ' + fa_getTrainOptions().populationCount + ')', Number) - .option('--generationCount ', 'generation count (default: ' + fa_getTrainOptions().generationCount + ')', Number) - .option('--selectionAmount ', 'how many chromosomes shall be selected from the old generation when constructing a new one (default: ' + fa_getTrainOptions().selectionAmount + ')', Number) - .option('--leafValueMutationProbability ', 'leaf value mutation probability (default: ' + fa_getTrainOptions().leafValueMutationProbability + ')', Number) - .option('--leafSignMutationProbability ', 'leaf sign mutation probability (default: ' + fa_getTrainOptions().leafSignMutationProbability + ')', Number) - .option('--logicalNodeMutationProbability ', 'logical node mutation probability (default: ' + fa_getTrainOptions().logicalNodeMutationProbability + ')', Number) - .option('--leafIndicatorMutationProbability ', 'leaf indicator mutation probability (default: ' + fa_getTrainOptions().leafIndicatorMutationProbability + ')', Number) - .option('--crossoverProbability ', 'crossover probability (default: ' + fa_getTrainOptions().crossoverProbability + ')', Number) - .option('--indicators ', 'comma separated list of TA-lib indicators (default: ' + fa_defaultIndicators.toString() + ', available: ' + fa_availableIndicators.toString() + ')', String) - - .action(function (selector, cmd) { - var s = {options: minimist(process.argv)} - var so = s.options - delete so._ - if (cmd.conf) { - var overrides = require(path.resolve(process.cwd(), cmd.conf)) - Object.keys(overrides).forEach(function (k) { - so[k] = overrides[k] - }) - } - Object.keys(conf).forEach(function (k) { - if (typeof cmd[k] !== 'undefined') { - so[k] = cmd[k] - } - }) - var tradesCollection = collectionService(conf).getTrades() - if (!so.days_test) { so.days_test = 0 } - so.strategy = 'noop' - - var unknownIndicators = [] - if (so.indicators) { - so.indicators.split(',').forEach(function(indicator) { - if (!fa_availableIndicators.includes(indicator)) - unknownIndicators.push(indicator) - }) - } - if (unknownIndicators.length > 0) { - console.error(('ERROR: The following indicators are not in forex.analytics: ').red + (unknownIndicators.toString()).yellow) - console.error('Available indicators: ' + fa_availableIndicators.toString()) - process.exit(1) - } - - if (so.start_training) { - so.start_training = moment(so.start_training).valueOf() - if (so.days_training && !so.end_training) { - so.end_training = tb(so.start_training).resize('1d').add(so.days_training).toMilliseconds() - } - } - if (so.end_training) { - so.end_training = moment(so.end_training).valueOf() - if (so.days_training && !so.start_training) { - so.start_training = tb(so.end_training).resize('1d').subtract(so.days_training).toMilliseconds() - } - } - if (!so.start_training && so.days_training) { - var d = tb('1d') - so.start_training = d.subtract(so.days_training).toMilliseconds() - } - so.selector = objectifySelector(selector || conf.selector) - so.mode = 'train' - - var engine = engineFactory(s, conf) - - if (!so.min_periods) so.min_periods = 1 - var cursor, reversing, reverse_point - var query_start = so.start_training ? tb(so.start_training).resize(so.period_length).subtract(so.min_periods + 2).toMilliseconds() : null - - function writeTempModel (strategy) { - var tempModelString = JSON.stringify( - { - 'selector': so.selector.normalized, - 'period': so.period_length, - 'start_training': moment(so.start_training), - 'end_training': moment(so.end_training), - 'options': fa_getTrainOptions(so), - 'strategy': strategy - }, null, 4) - - var tempModelHash = crypto.createHash('sha256').update(tempModelString).digest('hex') - var tempModelFile = 'models/temp.' + tempModelHash + '-' + moment(so.start_training).utc().format('YYYYMMDD_HHmmssZZ') + '.json' - - fs.writeFileSync( - tempModelFile, - tempModelString - ) - - return tempModelFile - } - - function writeFinalModel (strategy, end_training, trainingResult, testResult) { - var finalModelString = JSON.stringify( - { - 'selector': so.selector.normalized, - 'period': so.period_length, - 'start_training': moment(so.start_training).utc(), - 'end_training': moment(end_training).utc(), - 'result_training': trainingResult, - 'start_test': so.days_test > 0 ? moment(end_training).utc() : undefined, - 'result_test': testResult, - 'options': fa_getTrainOptions(so), - 'strategy': strategy - }, null, 4) - - var testVsBuyHold = typeof(testResult) !== 'undefined' ? testResult.vsBuyHold : 'noTest' - - var finalModelFile = 'models/forex.model_' + so.selector.normalized - + '_period=' + so.period_length - + '_from=' + moment(so.start_training).utc().format('YYYYMMDD_HHmmssZZ') - + '_to=' + moment(end_training).utc().format('YYYYMMDD_HHmmssZZ') - + '_trainingVsBuyHold=' + trainingResult.vsBuyHold - + '_testVsBuyHold=' + testVsBuyHold - + '_created=' + moment().utc().format('YYYYMMDD_HHmmssZZ') - + '.json' - - fs.writeFileSync( - finalModelFile, - finalModelString - ) - - return finalModelFile - } - - function parseSimulation (simulationResultFile) { - var endBalance = new RegExp(/end balance: .* \((.*)%\)/) - var buyHold = new RegExp(/buy hold: .* \((.*)%\)/) - var vsBuyHold = new RegExp(/vs\. buy hold: (.*)%/) - var trades = new RegExp(/([0-9].* trades over .* days \(avg (.*) trades\/day\))/) - var errorRate = new RegExp(/error rate: (.*)%/) - - var simulationResult = fs.readFileSync(simulationResultFile).toString() - simulationResult = simulationResult.substr(simulationResult.length - 512) - - var result = {} - if (simulationResult.match(endBalance)) { result.endBalance = simulationResult.match(endBalance)[1] } - if (simulationResult.match(buyHold)) { result.buyHold = simulationResult.match(buyHold)[1] } - if (simulationResult.match(vsBuyHold)) { result.vsBuyHold = simulationResult.match(vsBuyHold)[1] } - if (simulationResult.match(trades)) { - result.trades = simulationResult.match(trades)[1] - result.avgTradesPerDay = simulationResult.match(trades)[2] - } - if (simulationResult.match(errorRate)) { result.errorRate = simulationResult.match(errorRate)[1] } - - return result - } - - function trainingDone (strategy, lastPeriod) { - var tempModelFile = writeTempModel(strategy) - console.log('\nModel temporarily written to ' + tempModelFile) - - if (typeof(so.end_training) === 'undefined') { - so.end_training = lastPeriod.time * 1000 - } - - console.log( - '\nRunning simulation on training data from ' - + moment(so.start_training).format('YYYY-MM-DD HH:mm:ss ZZ') + ' to ' - + moment(so.end_training).format('YYYY-MM-DD HH:mm:ss ZZ') + '.\n' - ) - - var zenbot_cmd = process.platform === 'win32' ? 'zenbot.bat' : 'zenbot.sh' // Use 'win32' for 64 bit windows too - var trainingArgs = [ - 'sim', - so.selector.normalized, - '--strategy', 'forex_analytics', - '--disable_options', - '--modelfile', path.resolve(__dirname, '..', tempModelFile), - '--start', moment(so.start_training).format('YYYYMMDDHHmm'), - '--end', moment(so.end_training).format('YYYYMMDDHHmm'), - '--period', so.period_length, - '--filename', path.resolve(__dirname, '..', tempModelFile) + '-simTrainingResult.html' - ] - var trainingSimulation = spawn(path.resolve(__dirname, '..', zenbot_cmd), trainingArgs, { stdio: 'inherit' }) - - trainingSimulation.on('exit', function (code, signal) { - if (code) { - console.log('Child process exited with code ' + code + ' and signal ' + signal) - process.exit(code) - } - - var trainingResult = parseSimulation(path.resolve(__dirname, '..', tempModelFile)) - - console.log('Path:' + path.resolve(__dirname, '..', tempModelFile)) - if (so.days_test > 0) { - var endTest = moment(so.end_training).add(so.days_test, 'days') - - console.log('\nRunning simulation on test data from ' - + moment(so.end_training).format('YYYY-MM-DD HH:mm:ss ZZ') + ' to ' - + moment(endTest).format('YYYY-MM-DD HH:mm:ss ZZ') + ' (' + so.days_test + ' days).\n' - ) - - var testArgs = [ - 'sim', - so.selector.normalized, - '--strategy', 'forex_analytics', - '--disable_options', - '--modelfile', path.resolve(__dirname, '..', tempModelFile), - '--start', moment(so.end_training).format('YYYYMMDDHHmm'), - '--end', moment(endTest).format('YYYYMMDDHHmm'), - '--period', so.period_length, - '--filename', path.resolve(__dirname, '..', tempModelFile) + '-simTestResult.html', - ] - var testSimulation = spawn(path.resolve(__dirname, '..', zenbot_cmd), testArgs, { stdio: 'inherit' }) - - testSimulation.on('exit', function (code, signal) { - if (code) { - console.log('Child process exited with code ' + code + ' and signal ' + signal) - } - - var testResult = parseSimulation(path.resolve(__dirname, '..', tempModelFile) + '-simTestResult.html') - - var finalModelFile = writeFinalModel(strategy, so.end_training, trainingResult, testResult) - fs.rename(path.resolve(__dirname, '..', tempModelFile), path.resolve(__dirname, '..', finalModelFile)) - fs.rename(path.resolve(__dirname, '..', tempModelFile), path.resolve(__dirname, '..', finalModelFile)) - fs.unlink(path.resolve(__dirname, '..', tempModelFile)) - console.log('\nFinal model with results written to ' + finalModelFile) - - process.exit(0) - }) - } else { - var finalModelFile = writeFinalModel(strategy, so.end_training, trainingResult, undefined) - console.log('\nFinal model with results written to ' + finalModelFile) - - process.exit(0) - } - }) - } - - function createStrategy (candlesticks) { - var bar = new ProgressBar( - 'Training [:bar] :percent :etas - Fitness: :fitness', - { - width: 80, - total: fa_getTrainOptions(so).generationCount, - incomplete: ' ' - } - ) - - return analytics.findStrategy(candlesticks, fa_getTrainOptions(so), function(strategy, fitness/*, generation*/) { - bar.tick({ - 'fitness': fitness - }) - }) - } - - function createCandlesticks () { - console.log() - - if (!s.period) { - console.error('no trades found! try running `zenbot backfill ' + so.selector.normalized + '` first') - process.exit(1) - } - - var option_keys = Object.keys(so) - option_keys.sort(function (a, b) { - if (a < b) return -1 - return 1 - }) - var options = {} - option_keys.forEach(function (k) { - options[k] = so[k] - }) - - var candlesticks = [] - s.lookback.unshift(s.period) - s.lookback.slice(0, s.lookback.length - so.min_periods).map(function (period) { - var candlestick = { - open: period.open, - high: period.high, - low: period.low, - close: period.close, - time: period.time / 1000 - } - candlesticks.unshift(candlestick) - }) - - createStrategy(candlesticks) - .then(function(strategy) { - trainingDone(strategy, candlesticks[candlesticks.length - 1]) - }) - .catch(function(err) { - console.log(('Training error. Aborting.').red) - console.log(err) - process.exit(1) - }) - } - - function getTrades () { - var opts = { - query: { - selector: so.selector.normalized - }, - sort: {time: 1}, - limit: 1000 - } - if (so.end_training) { - opts.query.time = {$lte: so.end_training} - } - if (cursor) { - if (reversing) { - opts.query.time = {} - opts.query.time['$lt'] = cursor - if (query_start) { - opts.query.time['$gte'] = query_start - } - opts.sort = {time: -1} - } - else { - if (!opts.query.time) opts.query.time = {} - opts.query.time['$gt'] = cursor - } - } - else if (query_start) { - if (!opts.query.time) opts.query.time = {} - opts.query.time['$gte'] = query_start - } - tradesCollection.find(opts.query).limit(opts.limit).sort(opts.sort).toArray(function (err, trades) { - if (err) throw err - if (!trades.length) { - if (so.symmetrical && !reversing) { - reversing = true - reverse_point = cursor - return getTrades() - } - return createCandlesticks() - } - if (so.symmetrical && reversing) { - trades.forEach(function (trade) { - trade.orig_time = trade.time - trade.time = reverse_point + (reverse_point - trade.time) - }) - } - engine.update(trades, function (err) { - if (err) throw err - cursor = trades[trades.length - 1].time - setImmediate(getTrades) - }) - }) - } - - console.log('Generating training candlesticks from database...') - getTrades() - }) -} - diff --git a/docs/FAQ.md b/docs/FAQ.md index fc070b91dc..f90b405e9f 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -86,11 +86,9 @@ Yes, Zenbot can be installed on Windows, although it is recommended that Linux o Please note that these instructions are for Windows 10. -To install Zenbot on Windows it is currently required to have Visual Studio 2015 installed (because of the analytic-forex package). - 1. Install the "Bash on Windows subsystem" (see https://msdn.microsoft.com/en-us/commandline/wsl/about for more information) -> Note: You can then choose between Ubuntu, Fedora and OpenSUSE in the Windows store. +> Note: You can then choose between Ubuntu, Fedora and OpenSUSE in the Windows store. 2. Open a terminal window, your disks will now be mounted under `/mnt/*`. So for example navigate to your directory (example: `cd /mnt/c/zenbot`) @@ -117,7 +115,7 @@ Examples: ``` ./zenbot.sh backfill gdax.ETH-BTC ./zenbot.sh sim gdax.ETH-BTC --days=14 -zenbot sim --days 14 +zenbot sim --days 14 ``` You can [generate a command with this shared Google Docs spreadsheet](https://docs.google.com/spreadsheets/d/1HECEHW-I9Evve_FQV3LT_IWGV6FU34tHif9TEouKtfg/edit?usp=sharing). Do not hesitate to copy this file to your Google drive or download it as an spreadsheet, as everybody can modify it simultaneously. diff --git a/docs/README.md b/docs/README.md index e49d130b84..4d0b9378fa 100644 --- a/docs/README.md +++ b/docs/README.md @@ -61,7 +61,6 @@ npm install ./zenbot.sh trade --paper ``` -Please note; npm link will not work as forex.analytics is built from source. ### Docker (Optional) @@ -310,15 +309,6 @@ dema --overbought_rsi= sold when RSI exceeds this value (default: 80) --noise_level_pct= do not trade when short ema is with this % of last short ema, 0 disables this feature (default: 0) -forex_analytics - description: - Apply the trained forex analytics model. - options: - --modelfile= modelfile (generated by running `train`), should be in models/ (default: none) - --period= period length of a candlestick (default: 30m), same as --period_length (default: 30m) - --period_length= period length of a candlestick (default: 30m), same as --period (default: 30m) - --min_periods= min. number of history periods (default: 100) - macd description: Buy when (MACD - Signal > 0) and sell when (MACD - Signal < 0). @@ -359,7 +349,7 @@ neural noop description: - Just do nothing. Can be used to e.g. generate candlesticks for training the genetic forex strategy. + Just do nothing. Can be used to e.g. for training the strategy. options: --period= period length, same as --period_length (default: 30m) --period_length= period length, same as --period (default: 30m) @@ -775,4 +765,3 @@ Or to sell 10% of your BTC, ``` zenbot sell gdax.BTC-USD --pct=10 ``` - diff --git a/docs/installation/debian-ubuntu.md b/docs/installation/debian-ubuntu.md index 945006f6b4..5bc09b345e 100644 --- a/docs/installation/debian-ubuntu.md +++ b/docs/installation/debian-ubuntu.md @@ -18,7 +18,5 @@ npm install ./zenbot.sh --help ``` -**Note:** `npm link` will not work as forex.analytics is built from source. - [Blog Post (Ubuntu 16.04)](https://jaynagpaul.com/algorithmic-crypto-trading?utm_source=zenbot) [Video (Ubuntu 16.04)](https://youtu.be/BEhU55W9pBI) diff --git a/docs/strategies/list-strategies.md b/docs/strategies/list-strategies.md index 98cb21c504..855d2593c8 100644 --- a/docs/strategies/list-strategies.md +++ b/docs/strategies/list-strategies.md @@ -60,15 +60,6 @@ dema --overbought_rsi= sold when RSI exceeds this value (default: 80) --noise_level_pct= do not trade when short ema is with this % of last short ema, 0 disables this feature (default: 0) -forex_analytics - description: - Apply the trained forex analytics model. - options: - --modelfile= modelfile (generated by running `train`), should be in models/ (default: none) - --period= period length of a candlestick (default: 30m), same as --period_length (default: 30m) - --period_length= period length of a candlestick (default: 30m), same as --period (default: 30m) - --min_periods= min. number of history periods (default: 100) - macd description: Buy when (MACD - Signal > 0) and sell when (MACD - Signal < 0). @@ -109,7 +100,7 @@ neural noop description: - Just do nothing. Can be used to e.g. generate candlesticks for training the genetic forex strategy. + Just do nothing. Can be used to e.g. for training the strategy. options: --period= period length, same as --period_length (default: 30m) --period_length= period length, same as --period (default: 30m) diff --git a/docs/strategy_forex_analytics.md b/docs/strategy_forex_analytics.md deleted file mode 100644 index a600149fe2..0000000000 --- a/docs/strategy_forex_analytics.md +++ /dev/null @@ -1,68 +0,0 @@ -# Strategy: forex_analytics - -The forex_analytics is based on [forex.analytics by mkmarek](https://github.com/mkmarek/forex.analytics): - -> The result of technical analysis are two binary trees describing strategies for buy and sell signals which produced profit in a certain period of time specified by the input OHLC data set [i.e. candlesticks]. - -In a nutshell, the genetic optimization algorithm used by forex.analytics permutates thresholds used for a limited set of TA-Lib indicators to build a decision tree of different parameters and thresholds, which then result in either a `buy` or `sell` signal. In the end, different combinations of parameters and thresholds are used for either a `buy` or `sell` decision. - -Please also refer to [https://github.com/mkmarek/forex.analytics/blob/master/README.md](https://github.com/mkmarek/forex.analytics/blob/master/README.md). - -## Training -The strategy comes with a new `train` command to train a model on backfilled data. It is recommended to train the model first on a large _training dataset_ and then test the model on previously unseen data to evaluate performance and potential overfitting. This can be done by the `train` command, e.g. - -`./zenbot.sh train bitfinex.ETH-USD --days_training 42 --days_test 14` - -You can specify the following parameters for training: - -``` ---conf path to optional conf overrides file ---period period length of a candlestick (default: 30m) ---start_training start training at timestamp ---end_training end training at timestamp ---days_training set duration of training dataset by day count ---days_test set duration of test dataset to use with simulation, appended AFTER the training dataset (default: 0) ---populationCount population count (default: 100) ---generationCount generation count (default: 100) ---selectionAmount selection amount (default: 10) ---leafValueMutationProbability leaf value mutation probability (default: 0.5) ---leafSignMutationProbability leaf sign mutation probability (default: 0.3) ---logicalNodeMutationProbability logical node mutation probability (default: 0.3) ---leafIndicatorMutationProbability leaf indicator mutation probability (default: 0.2) ---crossoverProbability crossover probability (default: 0.03) ---indicators comma separated list of TA-lib indicators (default: CCI,MACD,RSI,SAR,Stochastic, available: ATR,BOP,CCI,MACD,MACD_Signal,MACD_Histogram,Momentum,RSI,SAR,SMA15_SMA50,Stochastic) --h, --help output usage information -``` - -You'll have to play around with the different settings for the genetic optimization algorithm, because we're also still in the process of learning them. - -The `train` command first generates the raw candlestick data, performs the training, saves the model to a temporary file and runs the simulations on the training and test dataset. - -You should expect that the _training dataset_ shows extremely good results, since the model has been tailored to it. The results from the _test dataset_ therefore show a more realistic picture. **Do choose a large enough _test dataset_ using `--days_test`.** - -The model, along with the HTML simulation results of both _training_ and _test dataset_, are then saved to the `models/` folder. - -## Trading - -You can use the trained model for trading using the normal `trade` command: - -`./zenbot.sh trade bitfinex.ETH-USD --strategy forex_analytics --modelfile models/trained_model_file.json --paper` - -There are not many options to specify. Usually, you only need to adapt `--modelfile` and `--period`. The period must be the same as in training/testing and zenbot will complain if it is not. - -Please note that you can share the model JSON files. zenbot is Open Source, we do share. When you find the holy model grail, please give back to the community ;) - -``` -forex_analytics - description: - Apply the trained forex analytics model. - options: - --modelfile= modelfile (generated by running `train`), should be in models/ (default: none) - --period= period length of a candlestick (default: 30m) (default: 30m) - --min_periods= min. number of history periods (default: 100) -``` - -## Limitations - -- Please be aware that you're fitting the model to retrospective data of a single exchange. There might be (a lot of) overfitting. As discussed, please use a large enough _test dataset_. -- The original forex.anayltics does not optimize for the length of the lookback periods for the TA-Lib indicators. This still needs work. We [filed an issue](https://github.com/mkmarek/forex.analytics/issues/11), but the project seems to be idle - a pull request would be highly appreciated. diff --git a/extensions/strategies/forex_analytics/strategy.js b/extensions/strategies/forex_analytics/strategy.js deleted file mode 100644 index 75bd6b32cb..0000000000 --- a/extensions/strategies/forex_analytics/strategy.js +++ /dev/null @@ -1,88 +0,0 @@ -var fs = require('fs') - , path = require('path') - , analytics = require('forex.analytics') - -var model -module.exports = { - name: 'forex_analytics', - description: 'Apply the trained forex analytics model.', - - getOptions: function (s) { - this.option('modelfile', 'modelfile (generated by running `train`), should be in models/', String, 'none') - this.option('period', 'period length of a candlestick (default: 30m), same as --period_length', String, '30m') - this.option('period_length', 'period length of a candlestick (default: 30m), same as --period', String, '30m') - this.option('min_periods', 'min. number of history periods', Number, 100) - - if (s.options) { - if (!s.options.modelfile) { - console.error('No modelfile specified. Please train a model and specify the resulting file.') - process.exit(1) - } - var modelfile - if (path.isAbsolute(s.options.modelfile)) { - modelfile = s.options.modelfile - } else { - modelfile = path.resolve(__dirname, '../../../', s.options.modelfile) - } - - if (fs.existsSync(modelfile)) { - model = require(modelfile) - } else { - console.error('Modelfile ' + modelfile + ' does not exist.') - process.exit(1) - } - - if (s.options.period !== model.period) { - console.error(('Error: Period in model training was ' + model.period + ', now you specified ' + s.options.period + '.').red) - process.exit(1) - } - } - }, - - calculate: function () { - // Calculations only done at the end of each period - }, - - onPeriod: function (s, cb) { - if (s.lookback.length > s.options.min_periods) { - var candlesticks = [] - - var candlestick = { - open: s.period.open, - high: s.period.high, - low: s.period.low, - close: s.period.close, - time: s.period.time / 1000 - } - candlesticks.unshift(candlestick) - - s.lookback.slice(0, s.lookback.length).map(function (period) { - var candlestick = { - open: period.open, - high: period.high, - low: period.low, - close: period.close, - time: period.time / 1000 - } - candlesticks.unshift(candlestick) - }) - - var result = analytics.getMarketStatus(candlesticks, {'strategy': model.strategy}) - if (result.shouldSell) { - s.signal = 'sell' - } else if (result.shouldBuy) { - s.signal = 'buy' - } - } - - cb() - }, - - onReport: function () { - var cols = [] - return cols - }, - - phenotypes: null -} - diff --git a/extensions/strategies/noop/strategy.js b/extensions/strategies/noop/strategy.js index cdaf1866ed..0afd37790a 100644 --- a/extensions/strategies/noop/strategy.js +++ b/extensions/strategies/noop/strategy.js @@ -1,6 +1,6 @@ module.exports = { name: 'noop', - description: 'Just do nothing. Can be used to e.g. generate candlesticks for training the genetic forex strategy.', + description: 'Just do nothing. Can be used to e.g. for training the strategy.', getOptions: function () { this.option('period', 'period length, same as --period_length', String, '30m') @@ -19,4 +19,3 @@ module.exports = { return cols } } - diff --git a/package-lock.json b/package-lock.json index f163fd9848..fa1b43ebf4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1669,9 +1669,9 @@ "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" }, "bindings": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.4.0.tgz", - "integrity": "sha512-7znEVX22Djn+nYjxCWKDne0RRloa9XfYa84yk3s+HkE3LpDYZmhArYr9O9huBoHY3/oXispx5LorIX7Sl2CgSQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "requires": { "file-uri-to-path": "1.0.0" } @@ -1974,11 +1974,6 @@ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" - }, "builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", @@ -4222,14 +4217,6 @@ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, - "forex.analytics": { - "version": "0.0.15", - "resolved": "https://registry.npmjs.org/forex.analytics/-/forex.analytics-0.0.15.tgz", - "integrity": "sha1-fIZQZ1yf6Z9fA72MlYek+Yt9d5k=", - "requires": { - "nan": "^2.2.0" - } - }, "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", @@ -4288,11 +4275,11 @@ "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=" }, "fs-minipass": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", "requires": { - "minipass": "^2.2.1" + "minipass": "^2.6.0" } }, "fs-write-stream-atomic": { @@ -5351,9 +5338,9 @@ "dev": true }, "ignore-walk": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.2.tgz", + "integrity": "sha512-EXyErtpHbn75ZTsOADsfx6J/FPo6/5cjev46PXrcTpd8z3BoRkXgYu9/JVqrI7tusjmwCZutGeRJeU0Wo1e4Cw==", "requires": { "minimatch": "^3.0.4" } @@ -5568,14 +5555,6 @@ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "requires": { - "builtin-modules": "^1.0.0" - } - }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", @@ -6396,11 +6375,6 @@ "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" - }, "lodash.defaults": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", @@ -6432,11 +6406,6 @@ "lodash.isarray": "^3.0.0" } }, - "lodash.mergewith": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", - "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==" - }, "lodash.restparam": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", @@ -6833,9 +6802,9 @@ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "minipass": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.6.4.tgz", + "integrity": "sha512-D/+wBy2YykFsCcWvaIslCKKus5tqGQZ8MhEzNx4mujLNgHhXWaaUOZkok6/kztAlTt0QkYLEyIShrybNmzoeTA==", "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -6849,9 +6818,9 @@ } }, "minizlib": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.2.tgz", + "integrity": "sha512-hR3At21uSrsjjDTWrbu0IMLTpnkpv8IIMFDFaoz43Tmu4LkmAXfH44vNNzpTnf+OAQQCHrb91y/wc2J4x5XgSQ==", "requires": { "minipass": "^2.2.1" } @@ -7084,27 +7053,22 @@ "dev": true }, "needle": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", - "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz", + "integrity": "sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg==", "requires": { - "debug": "^2.1.2", + "debug": "^3.2.6", "iconv-lite": "^0.4.4", "sax": "^1.2.4" }, "dependencies": { "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } }, @@ -7217,9 +7181,9 @@ } }, "node-pre-gyp": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", - "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.13.0.tgz", + "integrity": "sha512-Md1D3xnEne8b/HGVQkZZwV27WUi1ZRuZBij24TNaZwUPU3ZAFtvT6xxJGaUVillfmMKnn5oD1HoGsp2Ftik7SQ==", "requires": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", @@ -7243,22 +7207,22 @@ } }, "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, "tar": { - "version": "4.4.8", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", + "version": "4.4.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.11.tgz", + "integrity": "sha512-iI4zh3ktLJKaDNZKZc+fUONiQrSn9HkCFzamtb7k8FFmVilHVob7QsLX/VySAW8lAviMzMbFw4QtFb4errwgYA==", "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", + "minipass": "^2.6.4", + "minizlib": "^1.2.1", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" + "yallist": "^3.0.3" } }, "yallist": { @@ -7285,9 +7249,9 @@ } }, "node-sass": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.11.0.tgz", - "integrity": "sha512-bHUdHTphgQJZaF1LASx0kAviPH7sGlcyNhWade4eVIpFp6tsn7SV8xNMTbsQFpEV9VXpnwTTnNYlfsZXgGgmkA==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz", + "integrity": "sha512-A1Iv4oN+Iel6EPv77/HddXErL2a+gZ4uBeZUy+a8O35CFYTXhgA8MgLCWBtwpGZdCvTvQ9d+bQxX/QC36GDPpQ==", "requires": { "async-foreach": "^0.1.3", "chalk": "^1.1.1", @@ -7296,12 +7260,10 @@ "get-stdin": "^4.0.1", "glob": "^7.0.3", "in-publish": "^2.0.0", - "lodash.assign": "^4.2.0", - "lodash.clonedeep": "^4.3.2", - "lodash.mergewith": "^4.6.0", + "lodash": "^4.17.11", "meow": "^3.7.0", "mkdirp": "^0.5.1", - "nan": "^2.10.0", + "nan": "^2.13.2", "node-gyp": "^3.8.0", "npmlog": "^4.0.0", "request": "^2.88.0", @@ -7341,6 +7303,11 @@ "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -7491,20 +7458,20 @@ } }, "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "requires": { "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", + "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" }, "dependencies": { "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" } } }, @@ -11038,14 +11005,14 @@ } }, "npm-bundled": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", - "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==" }, "npm-packlist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.2.0.tgz", - "integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.4.tgz", + "integrity": "sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw==", "requires": { "ignore-walk": "^3.0.1", "npm-bundled": "^1.0.1" @@ -13337,11 +13304,18 @@ } }, "talib": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/talib/-/talib-1.0.6.tgz", - "integrity": "sha512-/6HB+gWU/ejUBOm4qa01TBeANfZhfCaxT3bZPYOCybVR/B/fJUdSv00C8bRIGJKjD+sVt/3/CeiaulnmwmshUg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/talib/-/talib-1.1.2.tgz", + "integrity": "sha512-uoUTUAhG8pti+VuQg7wrhFnebxdf35Bm/KmSh1WSyQVZbghKF8hXCaDTgVBAGH9kxZq4Cy1yZ6VCI0BfqJAtaA==", "requires": { - "nan": "^2.10.0" + "nan": "^2.13.2" + }, + "dependencies": { + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + } } }, "tapable": { @@ -13696,14 +13670,21 @@ "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=" }, "tulind": { - "version": "0.8.14", - "resolved": "https://registry.npmjs.org/tulind/-/tulind-0.8.14.tgz", - "integrity": "sha512-SiV8G3wa2JKJ8FZxHvNVf83TBwm7g3iLlwQqy/isETb5VlAxmycywzmI93uGop7o7vl9wUAhenbfIAONZVla8Q==", + "version": "0.8.18", + "resolved": "https://registry.npmjs.org/tulind/-/tulind-0.8.18.tgz", + "integrity": "sha512-GaXxYKVqf5TR0MOzLRMbk3ZDHa5ahTw8HshVFnK3KG70t5Mvlu0fIvT8foqBzpz+7Nvx9ig096e3GvPnZT8nKg==", "requires": { - "bindings": "^1.3.0", + "bindings": "^1.5.0", "minctest": "0.0.x", - "nan": "^2.10.0", - "node-pre-gyp": "^0.12.0" + "nan": "^2.14.0", + "node-pre-gyp": "^0.13.0" + }, + "dependencies": { + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + } } }, "tunnel-agent": { diff --git a/package.json b/package.json index 124573f6f5..b941e4e3c5 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "express-rate-limit": "^5.0.0", "extract-text-webpack-plugin": "^4.0.0-beta.0", "file-loader": "^4.0.0", - "forex.analytics": "^0.0.15", "fs": "0.0.1-security", "gemini-api": "^2.0.4", "glob": "^7.1.1", @@ -80,7 +79,7 @@ "mongodb": "^3.0.5", "node-bittrex-api": "^0.8.2", "node-prowl": "^0.1.7", - "node-sass": "^4.8.3", + "node-sass": "^4.12.0", "node-telegram-bot-api": "^0.30.0", "number-abbreviate": "^2.0.0", "numbro": "github:highvelocityspace/numbro", @@ -101,10 +100,10 @@ "stats-lite": "2.2.0", "style-loader": "^1.0.0", "superagent": "^5.0.2", - "talib": "^1.0.4", + "talib": "^1.1.2", "timebucket": "^0.4.0", "trend": "0.3.0", - "tulind": "^0.8.14", + "tulind": "^0.8.18", "url-loader": "^2.0.0", "uuid": "^3.1.0", "waypoints": "^4.0.1", @@ -123,6 +122,9 @@ "shelljs": "^0.8.0", "yargs": "^14.0.0" }, + "optionalDependencies": { + "fsevents": "^1.0.4" + }, "engines": { "node": ">=10.0.0" } diff --git a/post_install.js b/post_install.js index a8b0cb84ed..86daa47bc1 100644 --- a/post_install.js +++ b/post_install.js @@ -1,7 +1,5 @@ var shell = require('shelljs') -console.log('removing node_modules/forex.analytics/.git') -shell.rm('-rf', 'node_modules/forex.analytics/.git') console.log('bundling WebApp components') shell.exec('webpack -p') console.log('installing genetic_backtester components') diff --git a/scripts/genetic_algo/main.py b/scripts/genetic_algo/main.py index e54faafea4..441038fd33 100644 --- a/scripts/genetic_algo/main.py +++ b/scripts/genetic_algo/main.py @@ -27,7 +27,7 @@ def main(instrument, days, popsize, strategy='trend_ema'): Andividual.mutate = partial(mutGaussian, mu=0, sigma=sigma, indpb=indpb) # Andividual.strategy = strategy strategies = parsing.strategies() - Andividual.strategies = [st for st in strategies if 'forex' not in st] + Andividual.strategies = [st for st in strategies] print('using strategies:', Andividual.strategies) print(colored(f"Mating function is ", 'blue') + colored(Andividual.mate, 'green')) print(colored(f"Mutating function is ", 'blue') + colored(Andividual.mutate, 'green')) diff --git a/scripts/genetic_backtester/darwin.js b/scripts/genetic_backtester/darwin.js index 11f6c60b1b..ceddecb212 100755 --- a/scripts/genetic_backtester/darwin.js +++ b/scripts/genetic_backtester/darwin.js @@ -523,7 +523,7 @@ for (var i = 0; i < selectedStrategies.length; i++) { } else { if (strategyName === 'all') { - // skip it, probably just something like forex_analytics + // skip it selectedStrategies.splice(i, 1) i-- }