Advertisement
Guest User

Untitled

a guest
Jan 10th, 2019
1,640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.27 KB | None | 0 0
  1. // Everything is explained here:
  2. // @link https://gekko.wizb.it/docs/commandline/plugins.html
  3.  
  4. var config = {};
  5.  
  6. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. // GENERAL SETTINGS
  8. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  9.  
  10. config.debug = true; // for additional logging / debugging
  11.  
  12. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  13. // WATCHING A MARKET
  14. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15.  
  16. config.watch = {
  17.  
  18. // see https://gekko.wizb.it/docs/introduction/supported_exchanges.html
  19. exchange: 'kraken',
  20. currency: 'EUR',
  21. asset: 'ETH',
  22.  
  23. // You can set your own tickrate (refresh rate).
  24. // If you don't set it, the defaults are 2 sec for
  25. // okcoin and 20 sec for all other exchanges.
  26. // tickrate: 20
  27. }
  28.  
  29. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  30. // CONFIGURING TRADING ADVICE
  31. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  32.  
  33. config.tradingAdvisor = {
  34. enabled: true,
  35. method: 'SobhV5',
  36. candleSize: 1,
  37. historySize: 6240,
  38. }
  39.  
  40.  
  41.  
  42. config.T5mainasync = {
  43. setTakerLimit: '1%',
  44. setSellAmount: '100%',
  45. setBuyAmount: '99%',
  46. MACD: {
  47. optInFastPeriod: 12,
  48. optInSlowPeriod: 26,
  49. optInSignalPeriod: 9
  50. },
  51. EMAshort: {
  52. optInTimePeriod: 9
  53. },
  54. EMAlong: {
  55. optInTimePeriod: 21
  56. },
  57. STOCH: {
  58. optInFastKPeriod: 12,
  59. optInSlowKPeriod: 3,
  60. optInSlowDPeriod: 3
  61. },
  62. RSI: {
  63. optInTimePeriod: 14
  64. },
  65. thresholds: {
  66. RSIhigh: 66,
  67. RSIlow: 44,
  68. MACDhigh: 0,
  69. MACDlow: 0.88,
  70. persistance: 1
  71. }
  72. };
  73.  
  74. config.SobhV5 = {
  75. MACD: {
  76. optInFastPeriod: 12,
  77. optInSlowPeriod: 26,
  78. optInSignalPeriod: 9
  79. },
  80. RSI: {
  81. optInTimePeriod:14,
  82. },
  83. MFI: {
  84. optInTimePeriod:14,
  85. },
  86. };
  87.  
  88.  
  89. // MACD settings:
  90. config.MACD = {
  91. // EMA weight (α)
  92. // the higher the weight, the more smooth (and delayed) the line
  93. short: 10,
  94. long: 21,
  95. signal: 9,
  96. // the difference between the EMAs (to act as triggers)
  97. thresholds: {
  98. down: -0.025,
  99. up: 0.025,
  100. // How many candle intervals should a trend persist
  101. // before we consider it real?
  102. persistence: 1
  103. }
  104. };
  105.  
  106. // settings for other strategies can be found at the bottom, note that only
  107. // one strategy is active per gekko, the other settings are ignored.
  108.  
  109. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  110. // CONFIGURING PLUGINS
  111. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  112.  
  113. // do you want Gekko to simulate the profit of the strategy's own advice?
  114. config.paperTrader = {
  115. enabled: true,
  116. // report the profit in the currency or the asset?
  117. reportInCurrency: true,
  118. // start balance, on what the current balance is compared with
  119. simulationBalance: {
  120. // these are in the unit types configured in the watcher.
  121. asset: 1,
  122. currency: 100,
  123. },
  124. // how much fee in % does each trade cost?
  125. feeMaker: 0.15,
  126. feeTaker: 0.25,
  127. feeUsing: 'maker',
  128. // how much slippage/spread should Gekko assume per trade?
  129. slippage: 0.05,
  130. }
  131.  
  132. config.performanceAnalyzer = {
  133. enabled: true,
  134. riskFreeReturn: 5
  135. }
  136.  
  137. // Want Gekko to perform real trades on buy or sell advice?
  138. // Enabling this will activate trades for the market being
  139. // watched by `config.watch`.
  140. config.trader = {
  141. enabled: false,
  142. key: '',
  143. secret: '',
  144. username: '', // your username, only required for specific exchanges.
  145. passphrase: '', // GDAX, requires a passphrase.
  146. }
  147.  
  148. config.eventLogger = {
  149. enabled: false,
  150. // optionally pass a whitelist of events to log, if not past
  151. // the eventLogger will log _all_ events.
  152. // whitelist: ['portfolioChange', 'portfolioValueChange']
  153. }
  154.  
  155. config.pushover = {
  156. enabled: false,
  157. sendPushoverOnStart: false,
  158. muteSoft: true, // disable advice printout if it's soft
  159. tag: '[GEKKO]',
  160. key: '',
  161. user: ''
  162. }
  163.  
  164. // want Gekko to send a mail on buy or sell advice?
  165. config.mailer = {
  166. enabled: false, // Send Emails if true, false to turn off
  167. sendMailOnStart: true, // Send 'Gekko starting' message if true, not if false
  168.  
  169. email: '', // Your Gmail address
  170. muteSoft: true, // disable advice printout if it's soft
  171.  
  172. // You don't have to set your password here, if you leave it blank we will ask it
  173. // when Gekko's starts.
  174. //
  175. // NOTE: Gekko is an open source project < https://github.com/askmike/gekko >,
  176. // make sure you looked at the code or trust the maintainer of this bot when you
  177. // fill in your email and password.
  178. //
  179. // WARNING: If you have NOT downloaded Gekko from the github page above we CANNOT
  180. // guarantuee that your email address & password are safe!
  181.  
  182. password: '', // Your Gmail Password - if not supplied Gekko will prompt on startup.
  183.  
  184. tag: '[GEKKO] ', // Prefix all email subject lines with this
  185.  
  186. // ADVANCED MAIL SETTINGS
  187. // you can leave those as is if you
  188. // just want to use Gmail
  189.  
  190. server: 'smtp.gmail.com', // The name of YOUR outbound (SMTP) mail server.
  191. smtpauth: true, // Does SMTP server require authentication (true for Gmail)
  192. // The following 3 values default to the Email (above) if left blank
  193. user: '', // Your Email server user name - usually your full Email address '[email protected]'
  194. from: '', // '[email protected]'
  195. ssl: true, // Use SSL (true for Gmail)
  196. port: '', // Set if you don't want to use the default port
  197. }
  198.  
  199. config.pushbullet = {
  200. // sends pushbullets if true
  201. enabled: false,
  202. // Send 'Gekko starting' message if true
  203. sendMessageOnStart: true,
  204. // Send Message for advice? Recommend Flase for paper, true for live
  205. sendOnAdvice: true,
  206. // Send Message on Trade Completion?
  207. sendOnTrade: true,
  208. // For Overall P/L calc. Pass in old balance if desired, else leave '0'
  209. startingBalance: 0,
  210. // your pushbullet API key
  211. key: '',
  212. // your email
  213. email: '[email protected]',
  214. // Messages will start with this tag
  215. tag: '[GEKKO]'
  216. };
  217.  
  218. config.kodi = {
  219. // if you have a username & pass, add it like below
  220. // http://user:pass@ip-or-hostname:8080/jsonrpc
  221. host: 'http://ip-or-hostname:8080/jsonrpc',
  222. enabled: false,
  223. sendMessageOnStart: true,
  224. }
  225.  
  226. config.ircbot = {
  227. enabled: false,
  228. emitUpdates: false,
  229. muteSoft: true,
  230. channel: '#your-channel',
  231. server: 'irc.freenode.net',
  232. botName: 'gekkobot'
  233. }
  234.  
  235. config.telegrambot = {
  236. enabled: false,
  237. // Receive notifications for trades and warnings/errors related to trading
  238. emitTrades: false,
  239. token: 'YOUR_TELEGRAM_BOT_TOKEN',
  240. };
  241.  
  242. config.twitter = {
  243. // sends pushbullets if true
  244. enabled: false,
  245. // Send 'Gekko starting' message if true
  246. sendMessageOnStart: false,
  247. // disable advice printout if it's soft
  248. muteSoft: false,
  249. tag: '[GEKKO]',
  250. // twitter consumer key
  251. consumer_key: '',
  252. // twitter consumer secret
  253. consumer_secret: '',
  254. // twitter access token key
  255. access_token_key: '',
  256. // twitter access token secret
  257. access_token_secret: ''
  258. };
  259.  
  260. config.xmppbot = {
  261. enabled: false,
  262. emitUpdates: false,
  263. client_id: 'jabber_id',
  264. client_pwd: 'jabber_pw',
  265. client_host: 'jabber_server',
  266. client_port: 5222,
  267. status_msg: 'I\'m online',
  268. receiver: 'jabber_id_for_updates'
  269. }
  270.  
  271. config.campfire = {
  272. enabled: false,
  273. emitUpdates: false,
  274. nickname: 'Gordon',
  275. roomId: null,
  276. apiKey: '',
  277. account: ''
  278. }
  279.  
  280. config.redisBeacon = {
  281. enabled: false,
  282. port: 6379, // redis default
  283. host: '127.0.0.1', // localhost
  284. // On default Gekko broadcasts
  285. // events in the channel with
  286. // the name of the event, set
  287. // an optional prefix to the
  288. // channel name.
  289. channelPrefix: '',
  290. broadcast: [
  291. 'candle'
  292. ]
  293. }
  294.  
  295. config.slack = {
  296. enabled: false,
  297. token: '',
  298. sendMessageOnStart: true,
  299. muteSoft: true,
  300. channel: '' // #tradebot
  301. }
  302.  
  303. config.ifttt = {
  304. enabled: false,
  305. eventName: 'gekko',
  306. makerKey: '',
  307. muteSoft: true,
  308. sendMessageOnStart: true
  309. }
  310.  
  311. config.candleWriter = {
  312. enabled: true
  313. }
  314.  
  315. config.adviceWriter = {
  316. enabled: true,
  317. muteSoft: true,
  318. }
  319.  
  320. config.backtestResultExporter = {
  321. enabled: true,
  322. writeToDisk: true,
  323. data: {
  324. stratUpdates: false,
  325. portfolioValues: true,
  326. stratCandles: true,
  327. roundtrips: true,
  328. trades: true
  329. }
  330. }
  331.  
  332. config.candleUploader = {
  333. enabled: false,
  334. url: '',
  335. apiKey: ''
  336. }
  337.  
  338. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  339. // CONFIGURING ADAPTER
  340. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  341.  
  342. config.adapter = 'postgresql';
  343.  
  344. config.sqlite = {
  345. path: 'plugins/sqlite',
  346.  
  347. dataDirectory: 'history',
  348. version: 0.1,
  349.  
  350. journalMode: require('./web/isWindows.js') ? 'DELETE' : 'WAL',
  351.  
  352. dependencies: []
  353. }
  354.  
  355. // Postgres adapter example config (please note: requires postgres >= 9.5):
  356. config.postgresql = {
  357. path: 'plugins/postgresql',
  358. version: 0.1,
  359. connectionString: 'postgres://gekkodbuser:1234@localhost:5432', // if default port
  360. database: null, // if set, we'll put all tables into a single database.
  361. schema: 'public',
  362. dependencies: [{
  363. module: 'pg',
  364. version: '7.4.3'
  365. }]
  366. }
  367.  
  368. // Mongodb adapter, requires mongodb >= 3.3 (no version earlier tested)
  369. config.mongodb = {
  370. path: 'plugins/mongodb',
  371. version: 0.1,
  372. connectionString: 'mongodb://localhost/gekko', // connection to mongodb server
  373. dependencies: [{
  374. module: 'mongojs',
  375. version: '2.4.0'
  376. }]
  377. }
  378.  
  379. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  380. // CONFIGURING BACKTESTING
  381. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  382.  
  383. // Note that these settings are only used in backtesting mode, see here:
  384. // @link: https://gekko.wizb.it/docs/commandline/backtesting.html
  385.  
  386. config.backtest = {
  387. // daterange: 'scan',
  388. daterange: {
  389. from: "2018-12-01T00:00:00+02:00",
  390. to: "2019-01-01T09:00:00+02:00"
  391. },
  392. batchSize: 1
  393. }
  394.  
  395. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  396. // CONFIGURING IMPORTING
  397. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  398.  
  399. config.importer = {
  400. daterange: {
  401. // NOTE: these dates are in UTC
  402. from: "2018-12-01T00:00:00+02:00",
  403. to: "2019-01-01T09:00:00+02:00"
  404. }
  405. }
  406.  
  407.  
  408. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  409. // OTHER STRATEGY SETTINGS
  410. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  411.  
  412. // Exponential Moving Averages settings:
  413. config.DEMA = {
  414. // EMA weight (α)
  415. // the higher the weight, the more smooth (and delayed) the line
  416. weight: 21,
  417. // amount of candles to remember and base initial EMAs on
  418. // the difference between the EMAs (to act as triggers)
  419. thresholds: {
  420. down: -0.025,
  421. up: 0.025
  422. }
  423. };
  424.  
  425. // PPO settings:
  426. config.PPO = {
  427. // EMA weight (α)
  428. // the higher the weight, the more smooth (and delayed) the line
  429. short: 12,
  430. long: 26,
  431. signal: 9,
  432. // the difference between the EMAs (to act as triggers)
  433. thresholds: {
  434. down: -0.025,
  435. up: 0.025,
  436. // How many candle intervals should a trend persist
  437. // before we consider it real?
  438. persistence: 2
  439. }
  440. };
  441.  
  442. // Uses one of the momentum indicators but adjusts the thresholds when PPO is bullish or bearish
  443. // Uses settings from the ppo and momentum indicator config block
  444. config.varPPO = {
  445. momentum: 'TSI', // RSI, TSI or UO
  446. thresholds: {
  447. // new threshold is default threshold + PPOhist * PPOweight
  448. weightLow: 120,
  449. weightHigh: -120,
  450. // How many candle intervals should a trend persist
  451. // before we consider it real?
  452. persistence: 0
  453. }
  454. };
  455.  
  456. // RSI settings:
  457. config.RSI = {
  458. interval: 14,
  459. thresholds: {
  460. low: 30,
  461. high: 70,
  462. // How many candle intervals should a trend persist
  463. // before we consider it real?
  464. persistence: 1
  465. }
  466. };
  467.  
  468. // TSI settings:
  469. config.TSI = {
  470. short: 13,
  471. long: 25,
  472. thresholds: {
  473. low: -25,
  474. high: 25,
  475. // How many candle intervals should a trend persist
  476. // before we consider it real?
  477. persistence: 1
  478. }
  479. };
  480.  
  481. // Ultimate Oscillator Settings
  482. config.UO = {
  483. first: {
  484. weight: 4,
  485. period: 7
  486. },
  487. second: {
  488. weight: 2,
  489. period: 14
  490. },
  491. third: {
  492. weight: 1,
  493. period: 28
  494. },
  495. thresholds: {
  496. low: 30,
  497. high: 70,
  498. // How many candle intervals should a trend persist
  499. // before we consider it real?
  500. persistence: 1
  501. }
  502. };
  503.  
  504. // CCI Settings
  505. config.CCI = {
  506. constant: 0.015, // constant multiplier. 0.015 gets to around 70% fit
  507. history: 90, // history size, make same or smaller than history
  508. thresholds: {
  509. up: 100, // fixed values for overbuy upward trajectory
  510. down: -100, // fixed value for downward trajectory
  511. persistence: 0 // filter spikes by adding extra filters candles
  512. }
  513. };
  514.  
  515. // StochRSI settings
  516. config.StochRSI = {
  517. interval: 3,
  518. thresholds: {
  519. low: 20,
  520. high: 80,
  521. // How many candle intervals should a trend persist
  522. // before we consider it real?
  523. persistence: 3
  524. }
  525. };
  526.  
  527.  
  528. // custom settings:
  529. config.custom = {
  530. my_custom_setting: 10,
  531. }
  532.  
  533. config['talib-macd'] = {
  534. parameters: {
  535. optInFastPeriod: 10,
  536. optInSlowPeriod: 21,
  537. optInSignalPeriod: 9
  538. },
  539. thresholds: {
  540. down: -0.025,
  541. up: 0.025,
  542. }
  543. }
  544.  
  545. config['talib-macd'] = {
  546. parameters: {
  547. optInFastPeriod: 10,
  548. optInSlowPeriod: 21,
  549. optInSignalPeriod: 9
  550. },
  551. thresholds: {
  552. down: -0.025,
  553. up: 0.025,
  554. }
  555. }
  556.  
  557. config['tulip-adx'] = {
  558. optInTimePeriod: 10,
  559. thresholds: {
  560. down: -0.025,
  561. up: 0.025,
  562. }
  563. }
  564.  
  565.  
  566. // set this to true if you understand that Gekko will
  567. // invest according to how you configured the indicators.
  568. // None of the advice in the output is Gekko telling you
  569. // to take a certain position. Instead it is the result
  570. // of running the indicators you configured automatically.
  571. //
  572. // In other words: Gekko automates your trading strategies,
  573. // it doesn't advice on itself, only set to true if you truly
  574. // understand this.
  575. //
  576. // Not sure? Read this first: https://github.com/askmike/gekko/issues/201
  577. config['I understand that Gekko only automates MY OWN trading strategies'] = true;
  578.  
  579. module.exports = config;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement