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

Change markup_pct to new markdown and markup, set commonArgs so it is… #1047

Merged
merged 3 commits into from
Jan 5, 2018
Merged
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
40 changes: 26 additions & 14 deletions scripts/genetic_backtester/darwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ let NEUTRAL_RATE_AUTO = false;
let iterationCount = 0;

let runCommand = (taskStrategyName, phenotype, cb) => {
let commonArgs = `--strategy=${taskStrategyName} --period_length=${phenotype.period_length} --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.period_length} --min_periods=${phenotype.min_periods} --markdown_buy_pct=${phenotype.markdown_buy_pct} --markup_sell_pct=${phenotype.markup_sell_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}`,
crossover_vwap: `--emalen1=${phenotype.emalen1} --vwap_length=${phenotype.vwap_length} --vwap_max=${phenotype.vwap_max}`,
trendline: `--lastpoints=${phenotype.lastpoints} --avgpoints=${phenotype.avgpoints} --lastpoints2=${phenotype.lastpoints2} --avgpoints2=${phenotype.avgpoints2} --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}`,
srsi_macd: `--rsi_periods=${phenotype.rsi_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} --ema_short_period=${phenotype.ema_short_period} --ema_long_period=${phenotype.ema_long_period} --signal_period=${phenotype.signal_period} --up_trend_threshold=${phenotype.up_trend_threshold} --down_trend_threshold=${phenotype.down_trend_threshold}`,
Expand Down Expand Up @@ -164,7 +164,8 @@ let processOutput = output => {
days: days,
period_length: params.period_length,
min_periods: params.min_periods,
markup_pct: params.markup_pct,
markdown_buy_pct: params.markdown_buy_pct,
markup_sell_pct: params.markup_sell_pct,
order_type: params.order_type,
roi: roi,
wlRatio: losses > 0 ? roundp(wins / losses, 3) : 'Infinity',
Expand Down Expand Up @@ -258,7 +259,8 @@ let strategies = {
// -- common
period_length: RangePeriod(1, 120, 'm'),
min_periods: Range(1, 200),
markup_pct: RangeFloat(0, 5),
markdown_buy_pct: RangeFloat(-1, 5),
markup_sell_pct: RangeFloat(-1, 5),
order_type: RangeMakerTaker(),
sell_stop_pct: Range0(1, 50),
buy_stop_pct: Range0(1, 50),
Expand All @@ -281,7 +283,8 @@ let strategies = {
// -- common
period_length: RangePeriod(1, 120, 'm'),
min_periods: Range(1, 200),
markup_pct: RangeFloat(0, 5),
markdown_buy_pct: RangeFloat(-1, 5),
markup_sell_pct: RangeFloat(-1, 5),
order_type: RangeMakerTaker(),
sell_stop_pct: Range0(1, 50),
buy_stop_pct: Range0(1, 50),
Expand All @@ -305,7 +308,8 @@ let strategies = {
// -- common
period_length: RangePeriod(1, 120, 'm'),
min_periods: Range(1, 200),
markup_pct: RangeFloat(0, 5),
markdown_buy_pct: RangeFloat(-1, 5),
markup_sell_pct: RangeFloat(-1, 5),
order_type: RangeMakerTaker(),
sell_stop_pct: Range0(1, 50),
buy_stop_pct: Range0(1, 50),
Expand All @@ -325,7 +329,8 @@ let strategies = {
// -- common
period_length: RangePeriod(1, 120, 'm'),
min_periods: Range(1, 200),
markup_pct: RangeFloat(0, 5),
markdown_buy_pct: RangeFloat(-1, 5),
markup_sell_pct: RangeFloat(-1, 5),
order_type: RangeMakerTaker(),
sell_stop_pct: Range0(1, 50),
buy_stop_pct: Range0(1, 50),
Expand All @@ -344,7 +349,8 @@ let strategies = {
// -- common
period_length: RangePeriod(1, 120, 'm'),
min_periods: Range(1, 200),
markup_pct: RangeFloat(0, 5),
markdown_buy_pct: RangeFloat(-1, 5),
markup_sell_pct: RangeFloat(-1, 5),
order_type: RangeMakerTaker(),
sell_stop_pct: Range0(1, 50),
buy_stop_pct: Range0(1, 50),
Expand All @@ -363,7 +369,8 @@ let strategies = {
// -- common
period_length: RangePeriod(1, 120, 'm'),
min_periods: Range(2, 100),
markup_pct: RangeFloat(0, 5),
markdown_buy_pct: RangeFloat(-1, 5),
markup_sell_pct: RangeFloat(-1, 5),
order_type: RangeMakerTaker(),
sell_stop_pct: Range0(1, 50),
buy_stop_pct: Range0(1, 50),
Expand All @@ -378,7 +385,8 @@ let strategies = {
// -- common
period_length: RangePeriod(1, 120, 'm'),
min_periods: Range(1, 100),
markup_pct: RangeFloat(0, 5),
markdown_buy_pct: RangeFloat(-1, 5),
markup_sell_pct: RangeFloat(-1, 5),
order_type: RangeMakerTaker(),
sell_stop_pct: Range0(1, 50),
buy_stop_pct: Range0(1, 50),
Expand All @@ -393,7 +401,8 @@ let strategies = {
// -- common
period_length: RangePeriod(1, 120, 'm'),
min_periods: Range(1, 100),
markup_pct: RangeFloat(0, 5),
markdown_buy_pct: RangeFloat(-1, 5),
markup_sell_pct: RangeFloat(-1, 5),
order_type: RangeMakerTaker(),
sell_stop_pct: Range0(1, 50),
buy_stop_pct: Range0(1, 50),
Expand All @@ -409,7 +418,8 @@ let strategies = {
// -- common
period_length: RangePeriod(1, 120, 'm'),
min_periods: Range(1, 100),
markup_pct: RangeFloat(0, 5),
markdown_buy_pct: RangeFloat(-1, 5),
markup_sell_pct: RangeFloat(-1, 5),
order_type: RangeMakerTaker(),
sell_stop_pct: Range0(1, 50),
buy_stop_pct: Range0(1, 50),
Expand All @@ -428,7 +438,8 @@ let strategies = {
// -- common
period_length: RangePeriod(1, 120, 'm'),
min_periods: Range(1, 200),
markup_pct: RangeFloat(0, 5),
markdown_buy_pct: RangeFloat(-1, 5),
markup_sell_pct: RangeFloat(-1, 5),
order_type: RangeMakerTaker(),
sell_stop_pct: Range0(1, 50),
buy_stop_pct: Range0(1, 50),
Expand Down Expand Up @@ -467,7 +478,8 @@ let strategies = {
// -- common
period_length: RangePeriod(1, 120, 'm'),
min_periods: Range(1, 100),
markup_pct: RangeFloat(0, 5),
markdown_buy_pct: RangeFloat(-1, 5),
markup_sell_pct: RangeFloat(-1, 5),
order_type: RangeMakerTaker(),
sell_stop_pct: Range0(1, 50),
buy_stop_pct: Range0(1, 50),
Expand Down