Advertisement
Guest User

Untitled

a guest
Jul 10th, 2016
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Everything is explained here:
  2. // @link https://github.com/askmike/gekko/blob/stable/docs/Configuring_gekko.md
  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. // Monitor the live market
  17. config.watch = {
  18.   exchange: 'bitfinex', // see gekko/docs/supported_exchanges.md
  19.   currency: 'USD',
  20.   asset: 'BTC'
  21. }
  22.  
  23. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24. //                       CONFIGURING TRADING ADVICE
  25. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  26.  
  27. config.tradingAdvisor = {
  28.   enabled: true,
  29.   method: 'MACD',
  30.   candleSize: 15,
  31.   historySize: 25,
  32.   adapter: 'sqlite',
  33.   talib: {
  34.     enabled: false,
  35.     version: '1.0.2'
  36.   }
  37. }
  38.  
  39. // Exponential Moving Averages settings:
  40. config.DEMA = {
  41.   // EMA weight (α)
  42.   // the higher the weight, the more smooth (and delayed) the line
  43.   short: 10,
  44.   long: 21,
  45.   // amount of candles to remember and base initial EMAs on
  46.   // the difference between the EMAs (to act as triggers)
  47.   thresholds: {
  48.     down: -0.025,
  49.     up: 0.025
  50.   }
  51. };
  52.  
  53. // MACD settings:
  54. config.MACD = {
  55.   // EMA weight (α)
  56.   // the higher the weight, the more smooth (and delayed) the line
  57.   short: 10,
  58.   long: 21,
  59.   signal: 9,
  60.   // the difference between the EMAs (to act as triggers)
  61.   thresholds: {
  62.     down: -0.025,
  63.     up: 0.025,
  64.     // How many candle intervals should a trend persist
  65.     // before we consider it real?
  66.     persistence: 1
  67.   }
  68. };
  69.  
  70. // PPO settings:
  71. config.PPO = {
  72.   // EMA weight (α)
  73.   // the higher the weight, the more smooth (and delayed) the line
  74.   short: 12,
  75.   long: 26,
  76.   signal: 9,
  77.   // the difference between the EMAs (to act as triggers)
  78.   thresholds: {
  79.     down: -0.025,
  80.     up: 0.025,
  81.     // How many candle intervals should a trend persist
  82.     // before we consider it real?
  83.     persistence: 2
  84.   }
  85. };
  86.  
  87. // RSI settings:
  88. config.RSI = {
  89.   interval: 14,
  90.   thresholds: {
  91.     low: 30,
  92.     high: 70,
  93.     // How many candle intervals should a trend persist
  94.     // before we consider it real?
  95.     persistence: 1
  96.   }
  97. };
  98.  
  99. // CCI Settings
  100. config.CCI = {
  101.     constant: 0.015, // constant multiplier. 0.015 gets to around 70% fit
  102.     history: 90, // history size, make same or smaller than history
  103.     thresholds: {
  104.         up: 100, // fixed values for overbuy upward trajectory
  105.         down: -100, // fixed value for downward trajectory
  106.         persistence: 0 // filter spikes by adding extra filters candles
  107.     }
  108. };
  109.  
  110. // StochRSI settings
  111. config.StochRSI = {
  112.   interval: 3,
  113.   thresholds: {
  114.     low: 20,
  115.     high: 80,
  116.     // How many candle intervals should a trend persist
  117.     // before we consider it real?
  118.     persistence: 3
  119.   }
  120. };
  121.  
  122.  
  123. // custom settings:
  124. config.custom = {
  125.   my_custom_setting: 10,
  126. }
  127.  
  128. config['talib-macd'] = {
  129.   // FastPeriod, SlowPeriod, SignalPeriod
  130.   parameters: [10, 21, 9],
  131.   thresholds: {
  132.     down: -0.025,
  133.     up: 0.025,
  134.     // How many candle intervals should a trend persist
  135.     // before we consider it real?
  136.     persistence: 1
  137.   }
  138. }
  139.  
  140. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  141. //                       CONFIGURING PLUGINS
  142. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  143.  
  144. // Want Gekko to perform real trades on buy or sell advice?
  145. // Enabling this will activate trades for the market being
  146. // watched by `config.watch`.
  147. config.trader = {
  148.   enabled: true,
  149.   key: '',
  150.   secret: '',
  151.   username: '' // your username, only required for specific exchanges.
  152. }
  153.  
  154. config.adviceLogger = {
  155.   enabled: true
  156. }
  157.  
  158. // do you want Gekko to calculate the profit of its own advice?
  159. config.profitSimulator = {
  160.   enabled: false,
  161.   // report the profit in the currency or the asset?
  162.   reportInCurrency: true,
  163.   // start balance, on what the current balance is compared with
  164.   simulationBalance: {
  165.     // these are in the unit types configured in the watcher.
  166.     asset: 1,
  167.     currency: 100,
  168.   },
  169.   // only want report after a sell? set to `false`.
  170.   verbose: false,
  171.   // how much fee in % does each trade cost?
  172.   fee: 0.25,
  173.   // how much slippage/spread should Gekko assume per trade?
  174.   slippage: 0.05
  175. }
  176.  
  177. // want Gekko to send a mail on buy or sell advice?
  178. config.mailer = {
  179.   enabled: false,       // Send Emails if true, false to turn off
  180.   sendMailOnStart: true,    // Send 'Gekko starting' message if true, not if false
  181.  
  182.   email: '',    // Your Gmail address
  183.  
  184.   // You don't have to set your password here, if you leave it blank we will ask it
  185.   // when Gekko's starts.
  186.   //
  187.   // NOTE: Gekko is an open source project < https://github.com/askmike/gekko >,
  188.   // make sure you looked at the code or trust the maintainer of this bot when you
  189.   // fill in your email and password.
  190.   //
  191.   // WARNING: If you have NOT downloaded Gekko from the github page above we CANNOT
  192.   // guarantuee that your email address & password are safe!
  193.  
  194.   password: '',       // Your Gmail Password - if not supplied Gekko will prompt on startup.
  195.  
  196.   tag: '[GEKKO] ',      // Prefix all email subject lines with this
  197.  
  198.             //       ADVANCED MAIL SETTINGS
  199.             // you can leave those as is if you
  200.             // just want to use Gmail
  201.  
  202.   server: 'smtp.gmail.com',   // The name of YOUR outbound (SMTP) mail server.
  203.   smtpauth: true,     // Does SMTP server require authentication (true for Gmail)
  204.           // The following 3 values default to the Email (above) if left blank
  205.   user: '',       // Your Email server user name - usually your full Email address 'me@mydomain.com'
  206.   from: '',       // 'me@mydomain.com'
  207.   to: '',       // 'me@somedomain.com, me@someotherdomain.com'
  208.   ssl: true,        // Use SSL (true for Gmail)
  209.   port: '',       // Set if you don't want to use the default port
  210.   tls: false        // Use TLS if true
  211. }
  212.  
  213. config.ircbot = {
  214.   enabled: false,
  215.   emitUpdats: false,
  216.   channel: '#your-channel',
  217.   server: 'irc.freenode.net',
  218.   botName: 'gekkobot'
  219. }
  220.  
  221. config.xmppbot = {
  222.   enabled: false,
  223.   emitUpdats: false,
  224.   client_id: 'jabber_id',
  225.   client_pwd: 'jabber_pw',
  226.   client_host: 'jabber_server',
  227.   client_port: 5222,
  228.   status_msg: 'I\'m online',
  229.   receiver: 'jabber_id_for_updates'
  230. }
  231.  
  232. config.campfire = {
  233.   enabled: false,
  234.   emitUpdates: false,
  235.   nickname: 'Gordon',
  236.   roomId: null,
  237.   apiKey: '',
  238.   account: ''
  239. }
  240.  
  241. config.redisBeacon = {
  242.   enabled: false,
  243.   port: 6379, // redis default
  244.   host: '127.0.0.1', // localhost
  245.     // On default Gekko broadcasts
  246.     // events in the channel with
  247.     // the name of the event, set
  248.     // an optional prefix to the
  249.     // channel name.
  250.   channelPrefix: '',
  251.   broadcast: [
  252.     'candle'
  253.   ]
  254. }
  255.  
  256. config.candleWriter = {
  257.   adapter: 'sqlite',
  258.   enabled: true
  259. }
  260.  
  261. config.webserver = {
  262.   enabled: false,
  263.   http: {
  264.     port: 8080,
  265.     host: 'localhost'
  266.   },
  267.   ws: {
  268.     port: 8081,
  269.     host: 'localhost'
  270.   }
  271. }
  272.  
  273. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  274. //                       CONFIGURING ADAPTER
  275. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  276.  
  277. config.adapters = {
  278.   sqlite: {
  279.     path: 'plugins/sqlite',
  280.  
  281.     dataDirectory: './history',
  282.     version: 0.1,
  283.  
  284.     dependencies: [{
  285.       module: 'sqlite3',
  286.       version: '3.1.4'
  287.     }]
  288.   }
  289. }
  290.  
  291. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  292. //                       CONFIGURING BACKTESTING
  293. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  294.  
  295. // Note that these settings are only used in backtesting mode, see here:
  296. // @link: https://github.com/askmike/gekko/blob/stable/docs/Backtesting.md
  297.  
  298. config.backtest = {
  299.   adapter: 'sqlite',
  300.   daterange: 'scan',
  301.   batchSize: 50
  302. }
  303.  
  304. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  305. //                       CONFIGURING IMPORTING
  306. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  307.  
  308. config.importer = {
  309.   daterange: {
  310.     // NOTE: these dates are in UTC
  311.     from: "2015-09-09 12:00:00"
  312.   }
  313. }
  314.  
  315. // set this to true if you understand that Gekko will
  316. // invest according to how you configured the indicators.
  317. // None of the advice in the output is Gekko telling you
  318. // to take a certain position. Instead it is the result
  319. // of running the indicators you configured automatically.
  320. //
  321. // In other words: Gekko automates your trading strategies,
  322. // it doesn't advice on itself, only set to true if you truly
  323. // understand this.
  324. //
  325. // Not sure? Read this first: https://github.com/askmike/gekko/issues/201
  326. config['I understand that Gekko only automates MY OWN trading strategies'] = true;
  327.  
  328. module.exports = config;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement