Zenbot: How should look config for the exchange poloniex?

Created on 25 Aug 2016  路  14Comments  路  Source: DeviaVir/zenbot

Most helpful comment

@domgolonka, @carlos8f, I am still working on Poloniex support. I have been testing for about a week now with mixed results. At first I made a healthy 20% profit within 12-16 hours (trading ETC, FCT, and XMR) but then mongod crashed causing zenbot to lose connection. Since I was not home at the time (and did not have remote access zenbot was not running it could not trigger a sell on the downtrend and I lost all profits and then some. This was done with multiple pairs running at the same time. I also ran into a strange error with MongoDB where the entire terminal 'screen' turned green and I could not see any log info (it has also turned completely red in the past, I suspect the ANSI graph to be 'bleeding' into the terminal running mongod).

I am also getting many invalid nonce value errors. This only happens when zenbot is trading multiple pairs. I suspect that this can be fixed by adding nonce++ to either default_logic or somewhere in /core (perhaps in the async implementation). I do think this is causing substantial lag issues that effect performance and as a result lowers profitability.

To Do:

  • Properly Implement Orderbooks (Right now I am using a very hacky price multiplier which works but is not ideal since it doesn't take any real orders into account, thus it is very unreliable. It is only able to execute trades because Poloniex will automatically fill any orders that exist to the buy/sell price fed into the trade order). Using the Poloniex immediateOrCancel option zenbot will fill any existing orders to that price, and then Poloniex will auto cancel the rest so that there is not a sitting order as a result (I know 5% is ridiculous but i am only trading the highest volume pairs on Poloniex so I rarely run into a situation where zenbot has to fill more than a few existing orders).
          if (rs.op === 'buy') {
            params.rate += parseFloat(rs.market_price * 0.05)
            n(params.rate).format('0.00000000')
          }

  • Identify what is causing ANSI graph to 'bleed' into mongodb terminal
  • Fix MongoDB crash so that Mongo restarts on error and reconnect/restart zenbot
  • Fix any errors in my Poloniex trade logic and fix Poloniex nonce value (perhaps adding nonce++ to trade logic). I'm using a modified version of polo-node (poloniex-unofficial).
  • Get Poloniex Multi-Pair Trading to Reliable Profitability

Notes:

  • The trade module call looks like this:
          var polo = require('poloniex-unofficial')
          var nonce = require('nonce')()

          client = new polo.TradingWrapper(c.poloniex_key, c.poloniex_secret, nonce)
  • Poloniex will only allow up to 6 private trade method calls per second. I can not run more than 3-4 pairs without getting this error and even 4 is even a bit sketchy. If you get too many of these errors your IP can be banned from Poloniex. A fix may be to run zenbot on multiple IP's that are connected to the same MongoDB but I am not sure this will work as I haven't tested it. I will be trying out the
  • I keep getting a "aborting buy due to low perf." error while trading and running backetests. For example when trading/backtesting XMR/BTC just as zenbot gets about half way through the backtesting data every trade is aborted due to low perf and my profits get stuck at an roi of 1.22. This causes zenbot to completely miss the recent surge in price and prevents any further profits. This issue has also contributed to my recent losses which are around -35% :/ (I probably shouldn't be testing with a real balance but I feel it is the only real way to ensure poloniex_logic.js is working as intended). I do not feel comfortable publishing this code until it at least breaks even or I am able to resolve the query errors (I don't want to cause anyone to incur losses or get IP banned from Polo).
  • If I change perf to: rs.min_performance = -0.8 I get an awesome XMR/BTC ROI of 5.185861180412864 however this is not the case with most other pairs. FCT for example only gets an ROI of 1.3605448625604495, and this is only profitable in the last month. Before then it would consistently lose 20%, gain ~21% and repeat (with per at -0.8 until the recent surge in price.
  • My initial setup was using 3.5.14 and 3.5.15 without the RSI smoothing fix. I have since upgraded to 3.5.16 with mixed results. I am now tweaking settings and trying to get multi-pair trading to profitability.
  • I have yet to use the new docker, perhaps this will help with some of these issues.
  • I am getting slightly better results with rs.rsi_period = '15m' // RSI tick size but again this only applies to a few pairs.
  • I am now trying different rsi smoothing values +- 2 from 26 and 27-30 seems to be better for alt-coins but I have to continue to test these settings.
  • It would be awesome to have a function that would leverage zenbrain's machine-learning ability to test different logic rsi settings and create different profiles for every alt-coin, with the ability to hotswap in better settings as they are found (it will take me a while to figure out how to do this so any help with better understanding how zenbrain works and how to go about implementing this as well as other features such as identifying local price peaks would be awesome).
  • Zenbot is great at identifying uptrends, if I could get zenbot to identify local price peaks and sell while profitable it would free up BTC for trading with other pairs and has the potential for greatly increasing overall profits. I know the Stoch-RSI indicator has some functionality along these lines but I am wondering if you guys know of any other more reliable methods for determining 'local' peaks. This would be a new strategy entirely that would combine multiple indicators with zenbrain to only sell if profitable or at an acceptable loss percentage.
  • As of now my Poloniex logic is only losing $ or barely maintaining balance. Usually any profits made will be lost because of sell trend perf issues. There no reliable profits with these issues/errors trading any alt-coins so far.

I know this is a lot of info at once, any suggestions or help of any kind with these issues would be much appreciated. Thanks!

All 14 comments

+1 for this. There doesn't seem to be much documentation for using other exchanges.

Add poloniex to c.watch_exchanges in your config.js and the map/reduce will include poloniex trades. Trading is not implemented for Poloniex API yet though. See https://github.com/carlos8f/zenbot/pull/34 there are complications with needing order book logic.

Where can I look to fix the order book logic for poloniex? I want to start trading on Poloniex.

@domgolonka last week @JFD3D was working on some type of Poloniex trading support, I'm not sure what the status is of it though. I won't get around to porting the trading logic to other exchanges for at least a couple weeks.

@domgolonka, @carlos8f, I am still working on Poloniex support. I have been testing for about a week now with mixed results. At first I made a healthy 20% profit within 12-16 hours (trading ETC, FCT, and XMR) but then mongod crashed causing zenbot to lose connection. Since I was not home at the time (and did not have remote access zenbot was not running it could not trigger a sell on the downtrend and I lost all profits and then some. This was done with multiple pairs running at the same time. I also ran into a strange error with MongoDB where the entire terminal 'screen' turned green and I could not see any log info (it has also turned completely red in the past, I suspect the ANSI graph to be 'bleeding' into the terminal running mongod).

I am also getting many invalid nonce value errors. This only happens when zenbot is trading multiple pairs. I suspect that this can be fixed by adding nonce++ to either default_logic or somewhere in /core (perhaps in the async implementation). I do think this is causing substantial lag issues that effect performance and as a result lowers profitability.

To Do:

  • Properly Implement Orderbooks (Right now I am using a very hacky price multiplier which works but is not ideal since it doesn't take any real orders into account, thus it is very unreliable. It is only able to execute trades because Poloniex will automatically fill any orders that exist to the buy/sell price fed into the trade order). Using the Poloniex immediateOrCancel option zenbot will fill any existing orders to that price, and then Poloniex will auto cancel the rest so that there is not a sitting order as a result (I know 5% is ridiculous but i am only trading the highest volume pairs on Poloniex so I rarely run into a situation where zenbot has to fill more than a few existing orders).
          if (rs.op === 'buy') {
            params.rate += parseFloat(rs.market_price * 0.05)
            n(params.rate).format('0.00000000')
          }

  • Identify what is causing ANSI graph to 'bleed' into mongodb terminal
  • Fix MongoDB crash so that Mongo restarts on error and reconnect/restart zenbot
  • Fix any errors in my Poloniex trade logic and fix Poloniex nonce value (perhaps adding nonce++ to trade logic). I'm using a modified version of polo-node (poloniex-unofficial).
  • Get Poloniex Multi-Pair Trading to Reliable Profitability

Notes:

  • The trade module call looks like this:
          var polo = require('poloniex-unofficial')
          var nonce = require('nonce')()

          client = new polo.TradingWrapper(c.poloniex_key, c.poloniex_secret, nonce)
  • Poloniex will only allow up to 6 private trade method calls per second. I can not run more than 3-4 pairs without getting this error and even 4 is even a bit sketchy. If you get too many of these errors your IP can be banned from Poloniex. A fix may be to run zenbot on multiple IP's that are connected to the same MongoDB but I am not sure this will work as I haven't tested it. I will be trying out the
  • I keep getting a "aborting buy due to low perf." error while trading and running backetests. For example when trading/backtesting XMR/BTC just as zenbot gets about half way through the backtesting data every trade is aborted due to low perf and my profits get stuck at an roi of 1.22. This causes zenbot to completely miss the recent surge in price and prevents any further profits. This issue has also contributed to my recent losses which are around -35% :/ (I probably shouldn't be testing with a real balance but I feel it is the only real way to ensure poloniex_logic.js is working as intended). I do not feel comfortable publishing this code until it at least breaks even or I am able to resolve the query errors (I don't want to cause anyone to incur losses or get IP banned from Polo).
  • If I change perf to: rs.min_performance = -0.8 I get an awesome XMR/BTC ROI of 5.185861180412864 however this is not the case with most other pairs. FCT for example only gets an ROI of 1.3605448625604495, and this is only profitable in the last month. Before then it would consistently lose 20%, gain ~21% and repeat (with per at -0.8 until the recent surge in price.
  • My initial setup was using 3.5.14 and 3.5.15 without the RSI smoothing fix. I have since upgraded to 3.5.16 with mixed results. I am now tweaking settings and trying to get multi-pair trading to profitability.
  • I have yet to use the new docker, perhaps this will help with some of these issues.
  • I am getting slightly better results with rs.rsi_period = '15m' // RSI tick size but again this only applies to a few pairs.
  • I am now trying different rsi smoothing values +- 2 from 26 and 27-30 seems to be better for alt-coins but I have to continue to test these settings.
  • It would be awesome to have a function that would leverage zenbrain's machine-learning ability to test different logic rsi settings and create different profiles for every alt-coin, with the ability to hotswap in better settings as they are found (it will take me a while to figure out how to do this so any help with better understanding how zenbrain works and how to go about implementing this as well as other features such as identifying local price peaks would be awesome).
  • Zenbot is great at identifying uptrends, if I could get zenbot to identify local price peaks and sell while profitable it would free up BTC for trading with other pairs and has the potential for greatly increasing overall profits. I know the Stoch-RSI indicator has some functionality along these lines but I am wondering if you guys know of any other more reliable methods for determining 'local' peaks. This would be a new strategy entirely that would combine multiple indicators with zenbrain to only sell if profitable or at an acceptable loss percentage.
  • As of now my Poloniex logic is only losing $ or barely maintaining balance. Usually any profits made will be lost because of sell trend perf issues. There no reliable profits with these issues/errors trading any alt-coins so far.

I know this is a lot of info at once, any suggestions or help of any kind with these issues would be much appreciated. Thanks!

I please you to add support for poloniex exchange, because Coinbase exchange isn't anonymous. They follow transactions and check id etc.

@JFD3D regarding the nonce errors:

You can't send trade API calls asynchronously, because they may arrive out-of-order. Let's say you send a trade API call with the nonce 1, then one with the nonce 2, but due to the randomness of the network latency, or a delay with the orderbook processing, or for any other reason, the second call is processed first. The first call's nonce is now invalid. The only propery way is to wait for the first call to complete (i.e. return its answer) before sending the next one.

There is, however, a workaround. Each API key uses its own nonce counter, so if you generate multiple API keys for your account and then assign one key to each trading pair / thread, you shouldn't run into issues.

@scrawl @JFD3D
why not process calls in queue synchronously instead of creating multiple api keys?

@scrawl @egorbenko I've posted about using unique API keys (although not very user friendly) in the zenbot discord channel, it's linked in the README.md (Please Join in the discussion there, we can always use more input in real-time chat and I enjoy chatting there) I'm going to try defining the nonce value fresh right before every API call, I'll let you know if that works. I will also see if I can get async to do this although I've had some issues with that already.

It should look like this #79 :sweat_smile:

In the mean time I've decided to forgo the order book logic and use the Polo immediateOrCancel order flag with a slippage variable to ensure orders stay within a known %. Oh yea and Machine Learning. #79

@egorbenko I also may have figured out the proper way to async nonce, and I think the best way to do multi pair trading is to have many zenbot instances watching in 'adviser mode' and then spawn a live trading process once a buy signal is triggered per pair like we discussed on discord. BTW the discord channel has been pretty much dead since Carlos left so lets get that going again, I really enjoy the discussions there and they have lead to some good stuff. :+1:

@JFD3D have you finished Poloniex integration? If so, can you share with us?

yea... lol

(better yet how about bter?)

Zenbot 4 is out, so I'm cleaning up 3.x issues. It has Poloniex support. Please use and test 4, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrzobot picture mrzobot  路  3Comments

JensvdHeydt picture JensvdHeydt  路  3Comments

DeviaVir picture DeviaVir  路  3Comments

bbusche picture bbusche  路  5Comments

gleblanc1783 picture gleblanc1783  路  3Comments