Skip to content

Commit

Permalink
DeviaVir#926, DeviaVir#938, DeviaVir#940 - In the backtesters, renami…
Browse files Browse the repository at this point in the history
…ng instances of --period to --periodLength
  • Loading branch information
haxwell committed Dec 21, 2017
1 parent c124e8b commit e6f2f67
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/auto_backtester/backtester.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ let runCommand = (strategy, cb) => {
trend_ema: `--trend_ema=${strategy.trend_ema} --oversold_rsi=${strategy.oversold_rsi} --oversold_rsi_periods=${strategy.oversold_rsi_periods} --neutral_rate=${strategy.neutral_rate}`
};
let zenbot_cmd = process.platform === 'win32' ? 'zenbot.bat' : './zenbot.sh'; // Use 'win32' for 64 bit windows too
let command = `${zenbot_cmd} sim ${simArgs} ${strategyArgs[strategyName]} --period=${strategy.period} --min_periods=${strategy.min_periods}`;
let command = `${zenbot_cmd} sim ${simArgs} ${strategyArgs[strategyName]} --periodLength=${strategy.periodLength} --min_periods=${strategy.min_periods}`;
console.log(`[ ${countArr.length}/${strategies[strategyName].length} ] ${command}`);

shell.exec(command, {silent:true, async:true}, (code, stdout, stderr) => {
Expand Down Expand Up @@ -189,7 +189,7 @@ let processOutput = output => {
oversoldRsi: params.oversold_rsi,

days: days,
period: params.period,
period: params.periodLength,
min_periods: params.min_periods,
roi: roi,
wlRatio: losses > 0 ? roundp(wins / losses, 3) : 'Infinity',
Expand Down
5 changes: 3 additions & 2 deletions scripts/auto_backtester/backtester_trust_distrust.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ let objectProduct = obj => {

let runCommand = (strategy, cb) => {
countArr.push(1);
let command = `./zenbot.sh sim ${simArgs} --strategy=trust_distrust --period=${strategy.period}m --sell_threshold=${strategy.sell_threshold} --sell_threshold_max=${strategy.sell_threshold_max} --sell_min=${strategy.sell_min} --buy_threshold=${strategy.buy_threshold} --days=30`;
let command = `./zenbot.sh sim ${simArgs} --strategy=trust_distrust --periodLength=${strategy.periodLength}m --sell_threshold=${strategy.sell_threshold} --sell_threshold_max=${strategy.sell_threshold_max} --sell_min=${strategy.sell_min} --buy_threshold=${strategy.buy_threshold} --days=30`;
console.log(`[ ${countArr.length}/${strategies.length} ] ${command}`);

shell.exec(command, {silent:true, async:true}, (code, stdout, stderr) => {
Expand All @@ -90,6 +90,7 @@ let processOutput = output => {

let rawParams = jsonRegexp.exec(output2)[1];
let params = JSON.parse(rawParams);
debugger
let endBalance = endBalRegexp.exec(output2)[1];
let wlMatch = wlRegexp.exec(output2);
let wins = parseInt(wlMatch[1]);
Expand All @@ -113,7 +114,7 @@ let processOutput = output => {
sellMin: params.sell_min,
buyThreshold: params.buy_threshold,
days: days,
period: params.period,
period: params.periodLength,
roi: roi,
wlRatio: losses > 0 ? roundp(wins / losses, 3) : 'Infinity',
frequency: roundp((wins + losses) / days, 3)
Expand Down
4 changes: 2 additions & 2 deletions scripts/genetic_backtester/darwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let NEUTRAL_RATE_AUTO = false;
let iterationCount = 0;

let runCommand = (taskStrategyName, phenotype, cb) => {
let commonArgs = `--strategy=${taskStrategyName} --period=${phenotype.period} --min_periods=${phenotype.min_periods} --markup_pct=${phenotype.markup_pct} --order_type=${phenotype.order_type} --sell_stop_pct=${phenotype.sell_stop_pct} --buy_stop_pct=${phenotype.buy_stop_pct} --profit_stop_enable_pct=${phenotype.profit_stop_enable_pct} --profit_stop_pct=${phenotype.profit_stop_pct}`;
let commonArgs = `--strategy=${taskStrategyName} --periodLength=${phenotype.periodLength} --min_periods=${phenotype.min_periods} --markup_pct=${phenotype.markup_pct} --order_type=${phenotype.order_type} --sell_stop_pct=${phenotype.sell_stop_pct} --buy_stop_pct=${phenotype.buy_stop_pct} --profit_stop_enable_pct=${phenotype.profit_stop_enable_pct} --profit_stop_pct=${phenotype.profit_stop_pct}`;
let strategyArgs = {
crossover_vwap: `--emalen1=${phenotype.emalen1} --vwap_length=${phenotype.vwap_length} --vwap_max=${phenotype.vwap_max} --markdown_buy_pct=${phenotype.markdown_buy_pct} --markup_sell_pct=${phenotype.markup_sell_pct}`,
cci_srsi: `--cci_periods=${phenotype.rsi_periods} --rsi_periods=${phenotype.srsi_periods} --srsi_periods=${phenotype.srsi_periods} --srsi_k=${phenotype.srsi_k} --srsi_d=${phenotype.srsi_d} --oversold_rsi=${phenotype.oversold_rsi} --overbought_rsi=${phenotype.overbought_rsi} --oversold_cci=${phenotype.oversold_cci} --overbought_cci=${phenotype.overbought_cci} --constant=${phenotype.constant}`,
Expand Down Expand Up @@ -147,7 +147,7 @@ let processOutput = output => {
losses: losses,
errorRate: parseFloat(errorRate),
days: days,
period: params.period,
period: params.periodLength,
min_periods: params.min_periods,
markup_pct: params.markup_pct,
order_type: params.order_type,
Expand Down

0 comments on commit e6f2f67

Please sign in to comment.