Skip to content

Commit ce4ff40

Browse files
committed
add remaining toml method configs
1 parent 74b1369 commit ce4ff40

File tree

12 files changed

+78
-17
lines changed

12 files changed

+78
-17
lines changed

config/strategies/CCI.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# constant multiplier. 0.015 gets to around 70% fit
2+
constant = 0.015
3+
4+
# history size, make same or smaller than history
5+
history = 90
6+
7+
[thresholds]
8+
up = 100
9+
down = -100
10+
persistence = 0

config/strategies/DEMA.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
short = 10
2+
long = 21
3+
4+
[thresholds]
5+
down = -0.025
6+
up = 0.025

config/strategies/PPO.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
short = 12
2+
long = 26
3+
signal = 9
4+
5+
[thresholds]
6+
down = -0.025
7+
up = 0.025
8+
persistence = 2

config/strategies/StochRSI.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
interval = 3
2+
3+
[thresholds]
4+
low = 20
5+
high = 80
6+
persistence = 3

config/strategies/TSI.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
short = 13
2+
long = 25
3+
4+
[thresholds]
5+
low = -25
6+
high = 25
7+
persistence = 1

config/strategies/UO.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[first]
2+
weight = 4
3+
period = 7
4+
5+
[second]
6+
weight = 2
7+
period = 14
8+
9+
[third]
10+
weight = 1
11+
period = 28
12+
13+
[thresholds]
14+
low = 30
15+
hight = 70
16+
persistence = 1

config/strategies/talib-macd.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[parameters]
2+
optInFastPeriod = 10
3+
optInSlowPeriod = 21
4+
optInSignalPeriod = 9
5+
6+
[thresholds]
7+
down = -0.025
8+
up = 0.025

config/strategies/varPPO.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
momentum = TSI # RSI, TSI or UO
2+
3+
[thresholds]
4+
weightLow = 120
5+
weightHigh = -120
6+
7+
# How many candle intervals should a trend persist
8+
# before we consider it real?
9+
persistence = 0

core/markets/importer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var from = moment.utc(daterange.from);
1212

1313
if(daterange.to) {
1414
var to = moment.utc(daterange.to);
15-
} else{
15+
} else {
1616
var to = moment().utc();
1717
log.debug(
1818
'No end date specified for importing, setting to',

importers/exchanges/poloniex.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var done = false;
6161
var fetcher = new Fetcher(config.watch);
6262

6363
var fetch = () => {
64-
log.debug(
64+
log.info(
6565
'Requesting data from',
6666
iterator.from.format('YYYY-MM-DD HH:mm:ss') + ',',
6767
'to',
@@ -71,7 +71,6 @@ var fetch = () => {
7171
}
7272

7373
var handleFetch = trades => {
74-
7574
iterator.from.add(batchSize, 'minutes').subtract(overlapSize, 'minutes');
7675
iterator.to.add(batchSize, 'minutes').subtract(overlapSize, 'minutes');
7776

methods/CCI.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,9 @@ var config = require('../core/util.js').getConfig();
77
var settings = config.CCI;
88
var pposettings = config.PPO;
99

10-
1110
// let's create our own method
1211
var method = {};
1312

14-
// teach our trading method events
15-
var Util = require('util');
16-
//var EventEmitter = require('events').EventEmitter;
17-
//Util.inherits(TradingMethod, EventEmitter);
18-
19-
2013
// prepare everything our method needs
2114
method.init = function() {
2215
this.currentTrend;
@@ -31,13 +24,13 @@ method.init = function() {
3124
};
3225
this.historySize = config.tradingAdvisor.historySize;
3326
this.ppoadv = 'none';
34-
this.uplevel = config.CCI.thresholds.up;
35-
this.downlevel = config.CCI.thresholds.down;
36-
this.persisted = config.CCI.thresholds.persistence;
27+
this.uplevel = settings.thresholds.up;
28+
this.downlevel = settings.thresholds.down;
29+
this.persisted = settings.thresholds.persistence;
3730

3831
// log.debug("CCI started with:\nup:\t", this.uplevel, "\ndown:\t", this.downlevel, "\npersistence:\t", this.persisted);
3932
// define the indicators we need
40-
this.addIndicator('cci', 'CCI', config.CCI);
33+
this.addIndicator('cci', 'CCI', settings);
4134
}
4235

4336
// what happens on every new candle?
@@ -70,10 +63,8 @@ method.log = function() {
7063
*/
7164
method.check = function() {
7265

73-
7466
var price = this.lastPrice;
7567

76-
7768
this.age++;
7869
var cci = this.indicators.cci;
7970

@@ -91,6 +82,7 @@ method.check = function() {
9182
this.trend.adviced = false;
9283
if (this.persisted == 0) {
9384
this.trend.adviced = true;
85+
console.log(2);
9486
this.advice('short');
9587
}
9688
} else if (cci.result >= this.uplevel) {

methods/indicators/CCI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var Indicator = function(settings) {
88
this.tp = 0.0;
99
this.TP = new LRC(settings.history);
1010
this.result = false;
11-
this.hist = Array(); // needed for mean?
11+
this.hist = []; // needed for mean?
1212
this.mean = 0.0;
1313
this.size = 0;
1414
this.constant = settings.constant;

0 commit comments

Comments
 (0)