From f2aeddd6025a087d28edd78867c5fb7916b1933b Mon Sep 17 00:00:00 2001 From: Emanuele Bovisio <3024205+emabo@users.noreply.github.com> Date: Mon, 9 Oct 2017 21:32:10 +0200 Subject: [PATCH] change calls for zenbot script in genetic algo directory --- .gitignore | 1 + scripts/genetic_algo/evaluation.py | 2 +- scripts/genetic_algo/fabfile.py | 4 ++-- scripts/genetic_algo/parsing.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 77f44f5f2a..2950150c21 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ sim_result* backtesting_* models/*.json models/*.html +*.pyc diff --git a/scripts/genetic_algo/evaluation.py b/scripts/genetic_algo/evaluation.py index c37e6d4e15..05f96a770e 100644 --- a/scripts/genetic_algo/evaluation.py +++ b/scripts/genetic_algo/evaluation.py @@ -31,7 +31,7 @@ def runzen(cmdline): class Andividual(Individual): - BASE_COMMAND = '/app/zenbot.sh sim {instrument} --strategy {strategy} --avg_slippage_pct 0.33 --filename temp.html' + BASE_COMMAND = 'env node ../../zenbot.js sim {instrument} --strategy {strategy} --avg_slippage_pct 0.33 --filename temp.html' def __init__(self, *args,**kwargs): super(Andividual, self).__init__(*args, **kwargs) self.args = args_for_strategy(self.strategy) diff --git a/scripts/genetic_algo/fabfile.py b/scripts/genetic_algo/fabfile.py index 76bb1cefd0..ed86729c57 100644 --- a/scripts/genetic_algo/fabfile.py +++ b/scripts/genetic_algo/fabfile.py @@ -28,12 +28,12 @@ def remote(cmd, logfile): def backfill_remote(TOTAL_DAYS): products = ['gdax.BTC-EUR', 'gdax.BTC-USD', 'gdax.BTC-GBP']+['gdax.ETH-BTC', 'poloniex.ETH-BTC'] for instrument in products: - cmd = '../../zenbot.sh backfill {instrument} --days {days}'.format(days=TOTAL_DAYS, instrument=instrument) + cmd = 'env node ../../zenbot.js backfill {instrument} --days {days}'.format(days=TOTAL_DAYS, instrument=instrument) remote(cmd, 'backfill_'+instrument) def backfill_local(TOTAL_DAYS): products = ['gdax.BTC-EUR', 'gdax.BTC-USD', 'gdax.BTC-GBP']+['gdax.ETH-BTC', 'poloniex.ETH-BTC'] for instrument in products: - cmd = '/../../zenbot.sh backfill {instrument} --days {days}'.format(days=TOTAL_DAYS, instrument=instrument) + cmd = 'env node ../../zenbot.js backfill {instrument} --days {days}'.format(days=TOTAL_DAYS, instrument=instrument) local(cmd) diff --git a/scripts/genetic_algo/parsing.py b/scripts/genetic_algo/parsing.py index adc09e3bc4..14de108cac 100644 --- a/scripts/genetic_algo/parsing.py +++ b/scripts/genetic_algo/parsing.py @@ -15,7 +15,7 @@ def parse_trades(stuff): def args_for_strategy(strat): ansi_escape = re.compile(b'\x1b[^m]*m') - available = subprocess.check_output(shlex.split('/app/zenbot.sh list-strategies')) + available = subprocess.check_output(shlex.split('env node ../../zenbot.js list-strategies')) strats = [ansi_escape.sub(b'', strat.strip()) for strat in available.split(b'\n\n')] groups = [group.splitlines() for group in strats] output = {split[0].split()[0]: split[1:] for split in groups if split}