Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
VertigoRay committed Sep 12, 2017
2 parents 3040a6d + de65ad0 commit d7b37b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
15 changes: 8 additions & 7 deletions config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,21 @@ BTC-USD:
interval: 1000
buy:
amount: 0.01
only_when_trend_is_full: true
only_when_trend_is_full: false
post_only: true
cancel_after: min
below_midmarket: 0.01
below_midmarket: 0.01
spread_n: 3
spread_v: 0.50
sell:
post_only: true
above_buy: 0.01
strategy: StdDev
strategy: TrendLines
strategies:
StdDev:
trades_n: 1000
TrendLines:
trades_n: 1000
trendlines_n: 2
trades_n: 1000
trend_1_buy_on_up: true
Expand All @@ -69,7 +70,7 @@ ETH-USD:
interval: 1000
buy:
amount: 0.01
only_when_trend_is_full: true
only_when_trend_is_full: false
post_only: true
cancel_after: min
below_midmarket: 0.005
Expand All @@ -78,7 +79,7 @@ ETH-USD:
sell:
post_only: true
above_buy: 0.01
strategy: StdDev
strategy: TrendLines
strategies:
StdDev:
trades_n: 1000
Expand All @@ -96,7 +97,7 @@ LTC-USD:
interval: 1000
buy:
amount: 0.01
only_when_trend_is_full: true
only_when_trend_is_full: false
post_only: true
cancel_after: min
below_midmarket: 0.001
Expand All @@ -105,7 +106,7 @@ LTC-USD:
sell:
post_only: true
above_buy: 0.01
strategy: StdDev
strategy: TrendLines
strategies:
StdDev:
trades_n: 1000
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"gdax": "~0.4.2",
"glob": "^7.1.2",
"js-yaml": "^3.9.0",
"lodash": "^4.17.4",
"log": "^1.4.0",
"os-utils": "0.0.14",
"path": "^0.12.7",
Expand Down
9 changes: 6 additions & 3 deletions strategies/trendlines.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TrendLines {
for (let i=0; i < this.trend_lines.length; i++) {
this.trend_lines[i].push(parseFloat(trades[trade].toString()));

settings.get(`${this.product_id}.strategies.TrendLines.trendlines_n`)
settings.get(`${this.product_id}.strategies.TrendLines.trendlines_n`);

while (this.trend_lines[i].length > this.trades_n[i] + 1)
this.trend_lines[i].shift();
Expand All @@ -51,10 +51,13 @@ class TrendLines {
switch (this.product_id) {
case 'BTC-USD':
starting_price = Math.random() * 10000;
break;
case 'ETH-USD':
starting_price = Math.random() * 1000;
break;
case 'LTC-USD':
starting_price = Math.random() * 100;
break;
}

for (let i = 0; i < count; i++)
Expand All @@ -69,7 +72,7 @@ class TrendLines {
let strategy = {
trendlines_n: settings.get(`${this.product_id}.strategies.TrendLines.trendlines_n`),
last_trade_price: this.trend_lines[0][this.trend_lines[0].length - 1],
}
};

var is_trending_up = [];
var should_buy = [];
Expand Down Expand Up @@ -114,7 +117,7 @@ class TrendLines {
throw new Error(`The parameter 'set.product_id' is not valid (${set.product_id}); should be one of: ${settings.get('general.product_ids')}.`);


this.product_id = set.product_id
this.product_id = set.product_id;

for (let i=0; i < settings.get(`${this.product_id}.strategies.TrendLines.trendlines_n`); i++) {
this.trend_lines[i] = [];
Expand Down

0 comments on commit d7b37b0

Please sign in to comment.