forked from askmike/gekko
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config_backtest_test.js
439 lines (371 loc) · 10.5 KB
/
config_backtest_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
// Everything is explained here:
// @link https://gekko.wizb.it/docs/commandline/plugins.html
var config = {};
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// GENERAL SETTINGS
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.debug = true; // for additional logging / debugging
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// WATCHING A MARKET
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.watch = {
// see https://gekko.wizb.it/docs/introduction/supported_exchanges.html
exchange: 'kraken',
currency: 'EUR',
asset: 'COMP',
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CONFIGURING TRADING ADVICE
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.tradingAdvisor = {
enabled: true,
method: 'RSI_BULL_BEAR_ADX_PA',
candleSize: 15,
historySize: 80,
}
config.RSI_BULL_BEAR_ADX_PA = {
SMA:{
long: 1000,
short: 50},
BULL:{
rsi: 10,
high: 80,
low: 60,
mod_high: 5,
mod_low: -5},
BEAR:{
rsi: 15,
high: 50,
low: 20,
mod_high: 15,
mod_low: -5},
ADX:{
adx: 3,
high: 70,
low: 50}
};
// settings for other strategies can be found at the bottom, note that only
// one strategy is active per gekko, the other settings are ignored.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CONFIGURING PLUGINS
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// do you want Gekko to simulate the profit of the strategy's own advice?
config.paperTrader = {
enabled: true,
// report the profit in the currency or the asset?
reportInCurrency: true,
// start balance, on what the current balance is compared with
simulationBalance: {
// these are in the unit types configured in the watcher.
asset: 1,
currency: 100,
},
// how much fee in % does each trade cost?
feeMaker: 0.15,
feeTaker: 0.25,
feeUsing: 'maker',
// how much slippage/spread should Gekko assume per trade?
slippage: 0.05,
}
config.performanceAnalyzer = {
enabled: true,
riskFreeReturn: 5
}
// Want Gekko to perform real trades on buy or sell advice?
// Enabling this will activate trades for the market being
// watched by `config.watch`.
config.trader = {
enabled: false,
key: '',
secret: '',
username: '', // your username, only required for specific exchanges.
passphrase: '', // GDAX, requires a passphrase.
}
config.eventLogger = {
enabled: false,
// optionally pass a whitelist of events to log, if not past
// the eventLogger will log _all_ events.
// whitelist: ['portfolioChange', 'portfolioValueChange']
}
config.pushover = {
enabled: false,
sendPushoverOnStart: false,
muteSoft: true, // disable advice printout if it's soft
tag: '[GEKKO]',
key: '',
user: ''
}
config.blotter = {
enabled: false,
filename: 'blotter.csv',
dateFormat: 'l LT',
timezone: -300, // -300 minutes for EST(-5:00), only used if exchange doesn't provide correct timezone
}
// want Gekko to send a mail on buy or sell advice?
config.mailer = {
enabled: false, // Send Emails if true, false to turn off
sendMailOnStart: true, // Send 'Gekko starting' message if true, not if false
email: '', // Your Gmail address
muteSoft: true, // disable advice printout if it's soft
// You don't have to set your password here, if you leave it blank we will ask it
// when Gekko's starts.
//
// NOTE: Gekko is an open source project < https://github.com/askmike/gekko >,
// make sure you looked at the code or trust the maintainer of this bot when you
// fill in your email and password.
//
// WARNING: If you have NOT downloaded Gekko from the github page above we CANNOT
// guarantuee that your email address & password are safe!
password: '', // Your Gmail Password - if not supplied Gekko will prompt on startup.
tag: '[GEKKO] ', // Prefix all email subject lines with this
// ADVANCED MAIL SETTINGS
// you can leave those as is if you
// just want to use Gmail
server: 'smtp.gmail.com', // The name of YOUR outbound (SMTP) mail server.
smtpauth: true, // Does SMTP server require authentication (true for Gmail)
// The following 3 values default to the Email (above) if left blank
user: '', // Your Email server user name - usually your full Email address 'me@mydomain.com'
from: '', // 'me@mydomain.com'
to: '', // 'me@somedomain.com, me@someotherdomain.com'
ssl: true, // Use SSL (true for Gmail)
port: '', // Set if you don't want to use the default port
}
config.pushbullet = {
// sends pushbullets if true
enabled: false,
// Send 'Gekko starting' message if true
sendMessageOnStart: true,
// Send Message for advice? Recommend Flase for paper, true for live
sendOnAdvice: true,
// Send Message on Trade Completion?
sendOnTrade: true,
// For Overall P/L calc. Pass in old balance if desired, else leave '0'
startingBalance: 0,
// your pushbullet API key
key: '',
// your email
email: 'jon_snow@westeros.com',
// Messages will start with this tag
tag: '[GEKKO]'
};
config.kodi = {
// if you have a username & pass, add it like below
// http://user:pass@ip-or-hostname:8080/jsonrpc
host: 'http://ip-or-hostname:8080/jsonrpc',
enabled: false,
sendMessageOnStart: true,
}
config.ircbot = {
enabled: false,
emitUpdates: false,
muteSoft: true,
channel: '#your-channel',
server: 'irc.freenode.net',
botName: 'gekkobot'
}
config.telegrambot = {
enabled: false,
// Receive notifications for trades and warnings/errors related to trading
emitTrades: false,
token: 'YOUR_TELEGRAM_BOT_TOKEN',
};
config.twitter = {
// sends pushbullets if true
enabled: false,
// Send 'Gekko starting' message if true
sendMessageOnStart: false,
// disable advice printout if it's soft
muteSoft: false,
tag: '[GEKKO]',
// twitter consumer key
consumer_key: '',
// twitter consumer secret
consumer_secret: '',
// twitter access token key
access_token_key: '',
// twitter access token secret
access_token_secret: ''
};
config.xmppbot = {
enabled: false,
emitUpdates: false,
client_id: 'jabber_id',
client_pwd: 'jabber_pw',
client_host: 'jabber_server',
client_port: 5222,
status_msg: 'I\'m online',
receiver: 'jabber_id_for_updates'
}
config.campfire = {
enabled: false,
emitUpdates: false,
nickname: 'Gordon',
roomId: null,
apiKey: '',
account: ''
}
config.redisBeacon = {
enabled: false,
port: 6379, // redis default
host: '127.0.0.1', // localhost
// On default Gekko broadcasts
// events in the channel with
// the name of the event, set
// an optional prefix to the
// channel name.
channelPrefix: '',
broadcast: [
'candle'
]
}
config.slack = {
enabled: false,
token: '',
sendMessageOnStart: true,
muteSoft: true,
channel: '' // #tradebot
}
config.ifttt = {
enabled: false,
eventName: 'gekko',
makerKey: '',
muteSoft: true,
sendMessageOnStart: true
}
config.candleWriter = {
enabled: true
}
config.adviceWriter = {
enabled: false,
muteSoft: true,
}
config.backtestResultExporter = {
enabled: false,
writeToDisk: false,
data: {
stratUpdates: false,
portfolioValues: true,
stratCandles: true,
roundtrips: true,
trades: true
}
}
config.candleUploader = {
enabled: false,
url: '',
apiKey: ''
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CONFIGURING ADAPTER
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.adapter = 'sqlite';
config.sqlite = {
path: 'plugins/sqlite',
dataDirectory: 'history',
version: 0.1,
journalMode: require('./web/isWindows.js') ? 'DELETE' : 'WAL',
dependencies: []
}
config.bettersqlite = {
path: 'plugins/bettersqlite',
dataDirectory: 'history',
version: 0.1,
journalMode: require('./web/isWindows.js') ? 'DELETE' : 'WAL',
dependencies: []
}
// Postgres adapter example config (please note: requires postgres >= 9.5):
config.postgresql = {
path: 'plugins/postgresql',
version: 0.1,
connectionString: 'postgres://user:pass@localhost:5432', // if default port
database: null, // if set, we'll put all tables into a single database.
schema: 'public',
dependencies: [{
module: 'pg',
version: '7.4.3'
}]
}
// Mongodb adapter, requires mongodb >= 3.3 (no version earlier tested)
config.mongodb = {
path: 'plugins/mongodb',
version: 0.1,
connectionString: 'mongodb://localhost/gekko', // connection to mongodb server
dependencies: [{
module: 'mongojs',
version: '2.4.0'
}]
}
config.candleUploader = {
enabled: false,
url: '',
apiKey: ''
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CONFIGURING BACKTESTING
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Note that these settings are only used in backtesting mode, see here:
// @link: https://gekko.wizb.it/docs/commandline/backtesting.html
config.backtest = {
daterange: 'scan',
daterange: {
from: "2021-01-01 00:00:00",
to: "2021-02-20 00:00:00"
},
batchSize: 50
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CONFIGURING IMPORTING
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.importer = {
daterange: {
// NOTE: these dates are in UTC
from: "2021-02-01 00:00:00",
to: "2021-03-01 00:00:00"
}
}
// custom settings:
config.custom = {
my_custom_setting: 10,
}
config['talib-macd'] = {
parameters: {
optInFastPeriod: 10,
optInSlowPeriod: 21,
optInSignalPeriod: 9
},
thresholds: {
down: -0.025,
up: 0.025,
}
}
config['talib-macd'] = {
parameters: {
optInFastPeriod: 10,
optInSlowPeriod: 21,
optInSignalPeriod: 9
},
thresholds: {
down: -0.025,
up: 0.025,
}
}
config['tulip-adx'] = {
optInTimePeriod: 10,
thresholds: {
down: -0.025,
up: 0.025,
}
}
// set this to true if you understand that Gekko will
// invest according to how you configured the indicators.
// None of the advice in the output is Gekko telling you
// to take a certain position. Instead it is the result
// of running the indicators you configured automatically.
//
// In other words: Gekko automates your trading strategies,
// it doesn't advice on itself, only set to true if you truly
// understand this.
//
// Not sure? Read this first: https://github.com/askmike/gekko/issues/201
config['I understand that Gekko only automates MY OWN trading strategies'] = false;
module.exports = config;