askmike / gekko

A bitcoin trading bot written in node - https://gekko.wizb.it/
MIT License
10.07k stars 3.95k forks source link

ERROR LOADING DEPENDENCY sqlite3 #640

Closed decoye closed 7 years ago

decoye commented 7 years ago

Hey Mike,

you closed my previous error.

So to follow up.

When i start to watch a market gekko does not create any data in the history.

decoye commented 7 years ago

after a while when i want to do a backtest i get the following error

2017-03-21 14:53:41 (ERROR): ERROR LOADING DEPENDENCY sqlite3

askmike commented 7 years ago

2017-03-21 14:53:41 (ERROR): ERROR LOADING DEPENDENCY sqlite3

This is another error which was not posted in #638. Did you not post it in that issue for some reason, or do you see it when you are doing something else?

decoye commented 7 years ago

i did not foresee this error to be happening.

has there been some changes to the sample config file?

am i missing something?

decoye commented 7 years ago

to me it looks like it is not writing anything to the data base.

when i use the ui it writes to the db, but the cli backtester still cant find that data.

askmike commented 7 years ago

Assuming you are running the CLI version, not much has changed (except where in the config the db adapter was specified).

As for your error:

2017-03-21 14:53:41 (ERROR): ERROR LOADING DEPENDENCY sqlite3

I cannot debug this if you don't tell me exactly what is happening:

decoye commented 7 years ago

Im Running Dev branch CLI, command is: node gekko -c config.js and node gekko -c config.js --backtest

backtest result is: "ERROR: No history found for this market"

askmike commented 7 years ago

This is completely different from:

after a while when i want to do a backtest i get the following error 2017-03-21 14:53:41 (ERROR): ERROR LOADING DEPENDENCY sqlite3

Do you still have this error?

I have no clue what the issue is you are having right now.


backtest result is: "ERROR: No history found for this market"

This simply means that there is no data for the market you configured in your config.watch. So there is no error when backtesting (it is just saying "I cannot backtest because there is no data"). If you expected data to be there it is an error during importing.

So my questions are:

decoye commented 7 years ago

im used to type node gekko and gekko starts to gather data and eventually starts to gove advices boased on my config file.

since im using dev branch i need to give the following statements node gekko -c config.js

to make it start gathering data.

since this morning the issues started. first gekk told me sql database is not working properly and i need to update it with nmp to sql3.

and since i did that gekko does not log the data anymore from CLI.

stable still works like a charm.

askmike commented 7 years ago

can you post your config?

decoye commented 7 years ago

here is the config.

`// Everything is explained here: // @link https://github.com/askmike/gekko/blob/stable/docs/advanced_usage/plugins.md

var config = {};

// ~~~~~~~~~~~~~~~~ // GENERAL SETTINGS // ~~~~~~~~~~~~~~~~

config.debug = true; // for additional logging / debugging

// ~~~~~~~~~~~~~~~~ // WATCHING A MARKET // ~~~~~~~~~~~~~~~~

config.watch = {

// see https://github.com/askmike/gekko#supported-exchanges exchange: 'kraken', currency: 'EUR', asset: 'XBT' }

// ~~~~~~~~~~~~~~~~ // CONFIGURING TRADING ADVICE // ~~~~~~~~~~~~~~~~

config.tradingAdvisor = { enabled: true, method: 'DEMA', candleSize: 1, historySize: 3, adapter: 'sqlite', talib: { enabled: false, version: '1.0.2' } }

// Exponential Moving Averages settings: config.DEMA = { // EMA weight (α) // the higher the weight, the more smooth (and delayed) the line short: 10, long: 21, // amount of candles to remember and base initial EMAs on // the difference between the EMAs (to act as triggers) thresholds: { down: -0.025, up: 0.025 } };

// MACD settings: config.MACD = { // EMA weight (α) // the higher the weight, the more smooth (and delayed) the line short: 10, long: 21, signal: 9, // the difference between the EMAs (to act as triggers) thresholds: { down: -0.025, up: 0.025, // How many candle intervals should a trend persist // before we consider it real? persistence: 1 } };

// PPO settings: config.PPO = { // EMA weight (α) // the higher the weight, the more smooth (and delayed) the line short: 12, long: 26, signal: 9, // the difference between the EMAs (to act as triggers) thresholds: { down: -0.025, up: 0.025, // How many candle intervals should a trend persist // before we consider it real? persistence: 2 } };

// Uses one of the momentum indicators but adjusts the thresholds when PPO is bullish or bearish // Uses settings from the ppo and momentum indicator config block config.varPPO = { momentum: 'TSI', // RSI, TSI or UO thresholds: { // new threshold is default threshold + PPOhist * PPOweight weightLow: 120, weightHigh: -120, // How many candle intervals should a trend persist // before we consider it real? persistence: 0 } };

// RSI settings: config.RSI = { interval: 14, thresholds: { low: 30, high: 70, // How many candle intervals should a trend persist // before we consider it real? persistence: 1 } };

// TSI settings: config.TSI = { short: 13, long: 25, thresholds: { low: -25, high: 25, // How many candle intervals should a trend persist // before we consider it real? persistence: 1 } };

// Ultimate Oscillator Settings config.UO = { first: {weight: 4, period: 7}, second: {weight: 2, period: 14}, third: {weight: 1, period: 28}, thresholds: { low: 30, high: 70, // How many candle intervals should a trend persist // before we consider it real? persistence: 1 } };

// CCI Settings config.CCI = { constant: 0.015, // constant multiplier. 0.015 gets to around 70% fit history: 90, // history size, make same or smaller than history thresholds: { up: 100, // fixed values for overbuy upward trajectory down: -100, // fixed value for downward trajectory persistence: 0 // filter spikes by adding extra filters candles } };

// StochRSI settings config.StochRSI = { interval: 3, thresholds: { low: 20, high: 80, // How many candle intervals should a trend persist // before we consider it real? persistence: 3 } };

// 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, } }

// ~~~~~~~~~~~~~~~~ // CONFIGURING PLUGINS // ~~~~~~~~~~~~~~~~

// do you want Gekko to calculate the profit of its own advice? config.profitSimulator = { 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: 10, }, // how much fee in % does each trade cost? fee: 0.25, // how much slippage/spread should Gekko assume per trade? slippage: 0.10 }

// 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. }

config.adviceLogger = { enabled: false, muteSoft: true // disable advice printout if it's soft }

config.pushover = { enabled: false, sendPushoverOnStart: false, muteSoft: true, // disable advice printout if it's soft tag: '[GEKKO]', key: '', user: '' }

// 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, // disable advice printout if it's soft muteSoft: true, // your pushbullet API key key: 'xxx', // your email, change it unless you are Azor Ahai email: 'jon_snow@westeros.org', // will make Gekko messages start mit [GEKKO] tag: '[GEKKO]' };

config.ircbot = { enabled: false, emitUpdates: false, muteSoft: true, channel: '#your-channel', server: 'irc.freenode.net', botName: 'gekkobot' }

config.telegrambot = { enabled: false, emitUpdates: false, token: 'YOUR_TELEGRAM_BOT_TOKEN', botName: 'gekkobot' }

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.candleWriter = { enabled: true }

config.adviceWriter = { enabled: true, muteSoft: true, }

// ~~~~~~~~~~~~~~~~ // CONFIGURING ADAPTER // ~~~~~~~~~~~~~~~~

config.adapter = 'sqlite';

config.sqlite = { path: 'plugins/sqlite',

dataDirectory: 'history', version: 0.1,

dependencies: [{ module: 'sqlite3', version: '3.1.4' }] }

// 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 dependencies: [{ module: 'pg', version: '6.1.0' }] }

// Mongodb adapter, requires mongodb >= 3.3 (no version earlier tested) config.mongodb = { path: 'plugins/mongodb', version: 0.1, connectionString: 'mongodb://mongodb/gekko', // connection to mongodb server dependencies: [{ module: 'mongojs', version: '2.4.0' }] }

// ~~~~~~~~~~~~~~~~ // CONFIGURING BACKTESTING // ~~~~~~~~~~~~~~~~

// Note that these settings are only used in backtesting mode, see here: // @link: https://github.com/askmike/gekko/blob/stable/docs/Backtesting.md

config.backtest = { daterange: 'scan', batchSize: 50 }

// ~~~~~~~~~~~~~~~~ // CONFIGURING IMPORTING // ~~~~~~~~~~~~~~~~

config.importer = { daterange: { // NOTE: these dates are in UTC from: "2017-01-01 00:00:00" } }

// 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'] = true;

module.exports = config; `

askmike commented 7 years ago

You are using that config together with what command?

decoye commented 7 years ago

node gekko -c config-kraken.js

askmike commented 7 years ago

Could you open the Gekko folder and rename the folder history to history-backup and run the same command again:

node gekko -c config-kraken.js

And after that look into the new history folder and let me know all files inside the folder.

On Tue, Mar 21, 2017 at 6:40 PM, decoye notifications@github.com wrote:

node gekko -c config-kraken.js

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/askmike/gekko/issues/640#issuecomment-288178471, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7MD7YYh3s7NfcixdkgR4jmt5toNfe_ks5roBmbgaJpZM4Mj06U .

-- PGP key at keybase.io/mikevanrossum https://keybase.io/mikevanrossum/key.asc

decoye commented 7 years ago

kraken_0.1.db kraken_0.1.db-shm kraken_0.1.db-wal

askmike commented 7 years ago

and if you now try to backtest?

On Tue, Mar 21, 2017 at 6:45 PM, decoye notifications@github.com wrote:

kraken_0.1.db kraken_0.1.db-shm kraken_0.1.db-wal

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/askmike/gekko/issues/640#issuecomment-288179877, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7MD0syBs_C0KIOhDRQjSoqYPLOjXrLks5roBq-gaJpZM4Mj06U .

-- PGP key at keybase.io/mikevanrossum https://keybase.io/mikevanrossum/key.asc

decoye commented 7 years ago

this seems to work now. any idea what the issue is? database broken?

askmike commented 7 years ago

might be, but I've never seen it before. Glad we got it sorted though :)

On Tue, Mar 21, 2017 at 6:54 PM, decoye notifications@github.com wrote:

this seems to work now. any idea what the issue is? database broken?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/askmike/gekko/issues/640#issuecomment-288182428, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7MDxnadJiWg7g8usdoDT17BEzVsI9kks5roBzQgaJpZM4Mj06U .

-- PGP key at keybase.io/mikevanrossum https://keybase.io/mikevanrossum/key.asc