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

Commit

Permalink
Changed references in the Strategy objects of the backtesters to 'per…
Browse files Browse the repository at this point in the history
…iodLength' rather than 'period'. (#996)
  • Loading branch information
haxwell authored and DeviaVir committed Dec 28, 2017
1 parent 7cb42d5 commit 3d5b233
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions scripts/auto_backtester/backtester.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ let processOutput = output => {
oversoldRsi: params.oversold_rsi,

days: days,
period: params.periodLength,
periodLength: params.periodLength,
min_periods: params.min_periods,
roi: roi,
wlRatio: losses > 0 ? roundp(wins / losses, 3) : 'Infinity',
Expand All @@ -199,7 +199,7 @@ let processOutput = output => {

let strategies = {
cci_srsi: objectProduct({
period: ['20m'],
periodLength: ['20m'],
min_periods: [52, 200],
rsi_periods: [14, 20],
srsi_periods: [14, 20],
Expand All @@ -212,7 +212,7 @@ let strategies = {
constant: [0.015]
}),
srsi_macd: objectProduct({
period: ['30m'],
periodLength: ['30m'],
min_periods: [52, 200],
rsi_periods: [14, 20],
srsi_periods: [14, 20],
Expand All @@ -227,7 +227,7 @@ let strategies = {
down_trend_threshold: [0]
}),
macd: objectProduct({
period: ['1h'],
periodLength: ['1h'],
min_periods: [52],
ema_short_period: range(10, 15),
ema_long_period: range(20, 30),
Expand All @@ -238,7 +238,7 @@ let strategies = {
overbought_rsi: range(70, 70)
}),
rsi: objectProduct({
period: ['2m'],
periodLength: ['2m'],
min_periods: [52],
rsi_periods: range(10, 30),
oversold_rsi: range(20, 35),
Expand All @@ -248,19 +248,19 @@ let strategies = {
rsi_divisor: range(2, 2)
}),
sar: objectProduct({
period: ['2m'],
periodLength: ['2m'],
min_periods: [52],
sar_af: range(0.01, 0.055, 0.005),
sar_max_af: range(0.1, 0.55, 0.05)
}),
speed: objectProduct({
period: ['1m'],
periodLength: ['1m'],
min_periods: [52],
baseline_periods: range(1000, 5000, 200),
trigger_factor: range(1.0, 2.0, 0.1)
}),
trend_ema: objectProduct({
period: ['2m'],
periodLength: ['2m'],
min_periods: [52],
trend_ema: range(TREND_EMA_MIN, TREND_EMA_MAX),
neutral_rate: (NEUTRAL_RATE_AUTO ? new Array('auto') : []).concat(range(NEUTRAL_RATE_MIN, NEUTRAL_RATE_MAX).map(r => r / 100)),
Expand Down
6 changes: 3 additions & 3 deletions scripts/auto_backtester/backtester_trust_distrust.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* EMA Parameters: "trend_ema", "neutral_rate"
* RSI Parameters: "oversold_rsi", "oversold_rsi_periods"
*
* Example: ./backtester.js gdax.ETH-USD --days=10 --currency_capital=5 --period=1m
* Example: ./backtester.js gdax.ETH-USD --days=10 --currency_capital=5 --periodLength=1m
*/

let shell = require('shelljs');
Expand Down Expand Up @@ -114,7 +114,7 @@ let processOutput = output => {
sellMin: params.sell_min,
buyThreshold: params.buy_threshold,
days: days,
period: params.periodLength,
periodLength: params.periodLength,
roi: roi,
wlRatio: losses > 0 ? roundp(wins / losses, 3) : 'Infinity',
frequency: roundp((wins + losses) / days, 3)
Expand All @@ -126,7 +126,7 @@ let strategies = objectProduct({
sell_threshold_max: range(SELL_THRESHOLD_MAX_MIN, SELL_THRESHOLD_MAX_MAX),
sell_min: range(SELL_MIN_MIN, SELL_MIN_MAX),
buy_threshold: range(BUY_THRESHOLD_MIN, BUY_THRESHOLD_MAX),
period: range(PERIOD_MIN, PERIOD_MAX)
periodLength: range(PERIOD_MIN, PERIOD_MAX)
});

let tasks = strategies.map(strategy => {
Expand Down

0 comments on commit 3d5b233

Please sign in to comment.