Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Fix calls for running zenbot in genetic algo directory #603

Merged
merged 1 commit into from
Oct 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ sim_result*
backtesting_*
models/*.json
models/*.html
*.pyc
2 changes: 1 addition & 1 deletion scripts/genetic_algo/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the ../../ but why can't you use zenbot.sh?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because, otherwise I have this error:

module.js:473
throw err;
^

Error: Cannot find module '/home/emanuele/Code/zenbot.gh/scripts/genetic_algo/zenbot.js'
at Function.Module._resolveFilename (module.js:527:15)
at Function.Module._load (module.js:453:25)
at Function.Module.runMain (module.js:665:10)
at startup (bootstrap_node.js:201:16)
at bootstrap_node.js:626:3

it expects to find zenbot.js in current directory that is scripts/genetic_algo/

def __init__(self, *args,**kwargs):
super(Andividual, self).__init__(*args, **kwargs)
self.args = args_for_strategy(self.strategy)
Expand Down
4 changes: 2 additions & 2 deletions scripts/genetic_algo/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion scripts/genetic_algo/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down