zenbot icon indicating copy to clipboard operation
zenbot copied to clipboard

RSI always at 20

Open FreshLondon opened this issue 9 years ago • 29 comments

Every time i run the bot my RSI is always 20 or near there! Albeit I'm running a modded version of the poloniex bot, but havent changed anything RSI wise. Could this be an issue with how its calculating it?

At poresent its not performing well at all as the RSI is stuck on a fixed amount.

Anyone else experiencing the same?

FreshLondon avatar May 15 '17 08:05 FreshLondon

May i also ask, if i CTRL+C out of the current process and restart the bot - does this reset the RSI calc, or is the RSI calc stored and used again?

I restarted to get a fluctuating RSI between 48-53 but after stopping and starting the bot its quickly down back to 20.

Any help in understanding how this is worked out would be greatly appreciated.

FreshLondon avatar May 15 '17 17:05 FreshLondon

Hi,

The RSI in zenbot 3 uses the persistence of the run_state, so you can reset it either by dropping the run_state collection in mongo, or deleting just the record with the RSI's, or telling zenbot to create a new run_state with --rs some_new_run_state.

However, zenbot 4 will be dropping soon and it ditches RSI in favor of EMA, and also ditches the statically calculated map/reduce model and re-calculates indicators on the fly instead. So far it's much more agreeable to work with and I'd highly recommend waiting for it. It doesn't have Poloniex support yet, but I'm working on it.

carlos8f avatar May 16 '17 01:05 carlos8f

Hi, I'd like to help making support for Bitfinex. Where should I start, or is it too early for zenbot 4 to test?

nedievas avatar May 16 '17 04:05 nedievas

Hello, I already have done some programming on the Bitstamp APIfor zenbot 4, using GDAX as a template. However, I may need help with some functions as the Bitstamp API is quite different. The fact that Bitstamp doesn't supply much long term trade history may pose some challenges during development phase when the app needs a lot of stopping/starting.

@carlos8f: I don't feel well to make my own repository for Bitstamp, because I am an old man and not a node programmer meaning that I cannot make much of long term maintenance commitments, so please make the repository. I have the files. Maybe you could make a new discussion thread for work on APIs and/or a README documenting the API requirements?

@nedievas: Bitfinex would have been my next try. I am already using your Bitfinex implementation and have written the logic for Bitstamp using your work as a template.

Thanks

tuxitor avatar May 16 '17 05:05 tuxitor

the 4.x branch is relatively stable right now, and writing support for an exchange would consist of copying extensions/gdax to extensions/{exchange}, re-implementing the functions in exchange.js, and ensuring the input/output of the functions remains consistent with the GDAX api. I need to document exactly what zenbot requires, but you could play around with it now if you like.

@eigilb I appreciate your offer, but I'm hesitant to support Bitstamp mostly because the fees are too steep. They don't offer a 0% fee for makers, all order types have a 0.25% fee which I believe would make 1-2 trades per day (as 4.x currently averages) unprofitable. I'm aiming for zenbot 4.x to exclusively use post-only orders, and not incur fees (or at least Bitfinex cuts the fee in half). Also exchanges that I'm comfortable maintaining will be in the zenbot repo, and others (such as that don't allow US citizens to make accounts) could be maintained in external repos.

Also as you mentioned there is the trade history problem. There are some 3rd party free api's that may fill the gap, such as cryptowat.ch. zenbot 4 currently processes raw trades into OHLC, but for markets that have a historical OHLC api and no historical trades, I could probably adapt the engine to use either.

carlos8f avatar May 16 '17 05:05 carlos8f

the 4.x branch is relatively stable right now, and writing support for an exchange would consist of copying extensions/gdax to extensions/{exchange}, re-implementing the functions in exchange.js, and ensuring the input/output of the functions remains consistent with the GDAX api. I need to document exactly what zenbot requires, but you could play around with it now if you like.

That is exacly what I have done. Your API code is quite clear and slim, and most of the functions are straight forward to reimplement. The getTrades may need some more work, however.

I appreciate your offer, but I'm hesitant to support Bitstamp mostly because the fees are too steep. They don't offer a 0% fee for makers, all order types have a [0.25% fee]https://www.bitstamp.net/fee_schedule/) which I believe would make 1-2 trades per day (as 4.x currently averages) unprofitable. I'm aiming for zenbot 4.x to exclusively use post-only orders, and not incur fees (or at least Bitfinex cuts the fee in half. Also exchanges that I'm comfortable maintaining will be in the zenbot repo, and others (such as that don't allow US citizens to make accounts) could be maintained in external repos.

I am aware of the fee problem, but for people living in Europe, Bitstamp may be the easiest option. Money transfer is quick and easy using SEPA. I also made an account on GDAX, but unfortunately after depositing some coins there I discovered that GDAX don't allow people situated in Europe to trade USD. The only fiat option is EUR, and the volume on BTC-EUR market is very low, which resulted in withdrawal of my assets.

Also as you mentioned there is the trade history problem. There are some 3rd party free api's that may fill the gap, such as cryptowat.ch. zenbot 4 currently processes raw trades into OHLC, but for markets that have a historical OHLC api and no historical trades, I could probably adapt the engine to use either.

An option for me could be to have a daemon continuosly running in parallel just to collect trades from Bistamp into a db. Then zenbot could possibly look for trades in the db to fill the gap when starting after a longer stop. Bitfinex have the same history problem, BTW.

tuxitor avatar May 16 '17 06:05 tuxitor

An option for me could be to have a daemon continuosly running in parallel just to collect trades from Bistamp into a db.

currently in the 4.x branch you can do this by running another trade process with the --paper flag (the paper trades being ignored), I added realtime trade saving last night, which combined with the resuming backfiller that runs when the trade command starts, should fill the gap up to the present.

Bitfinex have the same history problem, BTW.

Yeah I may have to use cryptowat.ch API for that. Running trade currently requires about 2 days of trade data to warm up the EMA, and I think that should be fine with the rate-limit they use.

carlos8f avatar May 16 '17 06:05 carlos8f

@carlos8f is the 4.x branch stable enough to start using (with caution of course)?

urnotsam avatar May 16 '17 13:05 urnotsam

the 4.x branch is relatively stable right now, and writing support for an exchange would consist of copying extensions/gdax to extensions/{exchange}, re-implementing the functions in exchange.js, and ensuring the input/output of the functions remains consistent with the GDAX api. I need to document exactly what zenbot requires, but you could play around with it now if you like.

I tried to unsuccessfully test according to readme.md. Is there other way to make it run?

nedievas avatar May 16 '17 16:05 nedievas

I will try when i get home @nedievas. Are you switching to the 4.x branch when you follow the steps in the README.

urnotsam avatar May 16 '17 16:05 urnotsam

@urnotsam Yes. I use exactly 4.x branch.

[bfxbot@gene ~]$ cd zenbot-4.x/
[bfxbot@gene zenbot-4.x]$ ls
3x  boot.js  _codemap.js  commands  conf-sample.js  db  extensions  IDEA-watcher.md  index.js  lib  package.json  README.md  templates  zenbot.sh
[bfxbot@gene zenbot-4.x]$ npm install
[email protected] /home/bfxbot/zenbot-4.x
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected]
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   └── [email protected]
├── [email protected]  (git+https://github.com/carlos8f/numbro.git#e6e9a0d5f4c32939a7c19cf1546c7766b38cd31f)
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
└── [email protected]

npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
[bfxbot@gene zenbot-4.x]$ zenbot init
-bash: zenbot: command not found
[bfxbot@gene zenbot-4.x]$ ./zenbot.sh init
-bash: ./zenbot.sh: Permission denied
[bfxbot@gene zenbot-4.x]$ chmod 744 zenbot.sh
[bfxbot@gene zenbot-4.x]$ ./zenbot.sh init
module.js:471
    throw err;
    ^

Error: Cannot find module 'gdax'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/bfxbot/zenbot-4.x/extensions/gdax/exchange.js:1:74)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

That's it. Step by step of readme.md.

nedievas avatar May 16 '17 16:05 nedievas

It looks like you should make a new copy of sample-config.js and call it gdax.js and fill in the required parameters in there. Then also on line 24 of exchange.js you hsould replace 'YOUR-API-KEY' with the api key you just added to the new gdax.js.

I haven't tried this as im still at work, but reading through the code makes it seem like that is the problem. Let me know if it works.

urnotsam avatar May 16 '17 16:05 urnotsam

Nope. cp sample-config.js gdax.js does produce the same error. I don't have GDAX account, so I'm not able to have API key. But I suppose it is not necessary to collect public data.

There should be a node_module like gdax. But it is not installed by default.

nedievas avatar May 16 '17 16:05 nedievas

Hmm, okay. I will try to look into more later if no one has answered by then.

urnotsam avatar May 16 '17 16:05 urnotsam

Remember to also do a 'npm install' in the 'extension/gdax' directory

tuxitor avatar May 16 '17 16:05 tuxitor

Also the sample file is conf-sample.js. That was my bad so you should do cp conf-sample.js gdax.js and also do what @eigilb said.

urnotsam avatar May 16 '17 16:05 urnotsam

I did this in the / directory: [bfxbot@gene zenbot-4.x]$ npm install gdax and it came out:

[bfxbot@gene zenbot-4.x]$ ./zenbot.sh init

  Usage: zenbot [options] [command]


  Commands:

    list-selectors                 list available selectors
    backfill [options] [selector]  download historical trades for analysis
    sim [options] [selector]       run a simulation on backfilled data
    trade [options] [selector]     run trading bot against live market data
    buy [options] [selector]       execute a buy order to the exchange
    sell [options] [selector]      execute a sell order to the exchange

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

nedievas avatar May 16 '17 16:05 nedievas

also did as @eigilb said. The same output from zenbot init. Readme.md is obsolete. You Must follow this output options.

nedievas avatar May 16 '17 17:05 nedievas

@nedievas Great! now you can do some testing on backfill data and check how stable it is and its performance.

urnotsam avatar May 16 '17 17:05 urnotsam

A trick to do test runs without the risk of losing money is to generate key/secret pair with only RO permissions

tuxitor avatar May 16 '17 17:05 tuxitor