Pages:
Author

Topic: goxtool bot: portfolio rebalancing - page 2. (Read 26597 times)

hero member
Activity: 938
Merit: 500
https://youengine.io/
December 22, 2013, 08:03:24 PM
and in my signature the link for the main goxtool app. The only recommended and supported version.
hero member
Activity: 938
Merit: 500
https://youengine.io/
December 22, 2013, 08:00:51 PM
So you're telling me this has nothing to do with balancer.py from https://github.com/caktux/goxtool ?  Hmmmm.
Thats a fork of my original bot. I don't know what was changed in this fork and how to use it, I can only recommend my original as it is found in the link on page 1.
newbie
Activity: 16
Merit: 0
December 22, 2013, 07:57:36 PM
So you're telling me this has nothing to do with balancer.py from https://github.com/caktux/goxtool ?  Hmmmm.
hero member
Activity: 938
Merit: 500
https://youengine.io/
December 22, 2013, 07:53:13 PM
user.conf

The _balancer.py this thread is about has no "user.conf", please see the link to the original in post #1

You also wouldn't have needed any additional json packages, all of goxtool is using the built in json moule that comes with a standard python installation, I don't know what this balancer fork is doing or what it needs exotic additional json libs for.
newbie
Activity: 16
Merit: 0
December 22, 2013, 07:31:49 PM
I'm trying to get this to run on my linux box. I'm not normally a noob (been using linux since mid 90s) but I am a Python noob. If this was written in perl or something, no problem. Tongue

First problem was python-crypto wasn't installed. Second problem was python-simplejson wasn't installed.

 1807  apt-get install python-crypto
 1808  apt-get install python-simplejson

So after that, we have a new problem. (sorry for the spam, but this is how the output came out. I did delete screenfulls of blank lines at least.)


:~/goxtool$ ./goxtool.py --strategy=balancer.py
enter passphrase for secret:
testing secret...
testing key...
ok :-)

Price: 0.000000 - 0.000000 | Market: BTCUSD | Account: No info (yet)
sum_bid: 0 USD | sum_ask: 0 BTC | ratio: - USD/BTC | lag:  / 0.000 s (order / socket)

                                                                   
### shutdown...                                                     
                                                                   


*** error(s) in curses_loop() that caused unclean shutdown:

                                                           Traceback (most recent call last):
                                                                                               File "./goxtool.py", line 1592, in curses_loop
             strategy_manager = StrategyManager(gox, strat_mod_list)
                                                                      File "./goxtool.py", line 1476, in __init__
                                                                                                                     self.reload()
                                                                                                                                    File "./goxtool.py", line 1490, in reload
                                             strategy_module = __import__(name)
                                                                                 File "/home/leela/goxtool/balancer.py", line 16, in
              conf = json.load(open("user.conf"))
                                                 IOError: [Errno 2] No such file or directory: 'user.conf'

                                                                                                          Traceback (most recent call last):
          File "./goxtool.py", line 1679, in curses_loop
                                                            strategy_manager.unload()
                                                                                     UnboundLocalError: local variable 'strategy_manager' referenced before assignment


Exception in thread Thread-1 (most likely raised during interpreter shutdown):
                                                                              Traceback (most recent call last):
                                                                                                                  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
                                                      File "/usr/lib/python2.7/threading.py", line 757, in run
                                                                                                                File "/usr/lib/python2.7/threading.py", line 403, in wait
                                       File "/usr/lib/python2.7/threading.py", line 267, in wait
                                                                                                : list.remove(x): x not in list
                         :~/goxtool$


Okay, so lets create user.conf.


:~/goxtool$ touch user.conf
:~/goxtool$ ./goxtool.py --strategy=balancer.py
enter passphrase for secret:
testing secret...
testing key...
ok :-)


Price: 0.000000 - 0.000000 | Market: BTCUSD | Account: No info (yet)
sum_bid: 0 USD | sum_ask: 0 BTC | ratio: - USD/BTC | lag:  / 0.000 s (order / socket)

                                                                   
### shutdown...                                                     
                                                                                                                 

*** error(s) in curses_loop() that caused unclean shutdown:

                                                           Traceback (most recent call last):
                                                                                               File "./goxtool.py", line 1592, in curses_loop
             strategy_manager = StrategyManager(gox, strat_mod_list)
                                                                      File "./goxtool.py", line 1476, in __init__
                                                                                                                     self.reload()
                                                                                                                                    File "./goxtool.py", line 1490, in reload
                                             strategy_module = __import__(name)
                                                                                 File "/home/leela/goxtool/balancer.py", line 16, in
              conf = json.load(open("user.conf"))
                                                   File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 357, in load
    use_decimal=use_decimal, **kw)
                                    File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 413, in loads
                                                                                                                          return _default_decoder.decode(s)
                         File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 402, in decode
                                                                                                               obj, end = self.raw_decode(s, idx=_w(s, 0).end())
                              File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 420, in raw_decode
                                                                                                                        raise JSONDecodeError("No JSON object could be decoded", s, idx)
                                                    JSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0)

                                                                                                                              Traceback (most recent call last):
                              File "./goxtool.py", line 1679, in curses_loop
                                                                                strategy_manager.unload()
                                                                                                         UnboundLocalError: local variable 'strategy_manager' referenced before assignment


Exception in thread Thread-1 (most likely raised during interpreter shutdown):
                                                                              Traceback (most recent call last):
                                                                                                                  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
                                                      File "/usr/lib/python2.7/threading.py", line 757, in run
                                                                                                                File "/usr/lib/python2.7/threading.py", line 403, in wait
                                       File "/usr/lib/python2.7/threading.py", line 267, in wait
                                                                                                : list.remove(x): x not in list
                          Exception in thread Thread-2 (most likely raised during interpreter shutdown):
                                                                                                        Traceback (most recent call last):
        File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
                                                                                File "/usr/lib/python2.7/threading.py", line 759, in run
      File "/home/leela/goxtool/goxapi.py", line 431, in _fire
                                                                 File "/home/leela/goxtool/goxapi.py", line 371, in __call__
                                                                                                                               File "/usr/lib/python2.7/threading.py", line 121, in acquire
                                                       : 'NoneType' object is not callable
                                                                                                                       :~/goxtool$



Urghh.

The code in balancer.py has:


# Load user.conf
conf = json.load(open("user.conf"))

# Set defaults
conf.setdefault('balancer_simulate', True)
conf.setdefault('balancer_distance', 7)
conf.setdefault('balancer_fiat_cold', 0)
conf.setdefault('balancer_coin_cold', 0)
conf.setdefault('balancer_marker', 7)
conf.setdefault('balancer_compensate_fees', False)
conf.setdefault('balancer_target_margin', 1)


So I assume it would use those as defaults if there's nothing in the conf file...

Anyway, I don't know if I've pulled some new version from git or what because there's no instructions in this thread or the goxtool website about needing this conf file or what to put in it...
member
Activity: 103
Merit: 10
December 18, 2013, 04:45:05 AM
0.05BTC
Is not enough. please read the thread, I have mentioned it multiple times. Load it at least with a few thousand dollars for it to make any sense. Minimum order size on gox is 0.01BTC, if you do the math you will see that your rebalancing orders would be too small by orders of magnitude.

I'm sorry, I wasn't thinking straight!
Was reading through the code and let it run simultaneously to test it...without thinking about the minimum order size. I will try it again later.
Thanks for your work!
hero member
Activity: 938
Merit: 500
https://youengine.io/
December 17, 2013, 02:39:27 PM
0.05BTC
Is not enough. please read the thread, I have mentioned it multiple times. Load it at least with a few thousand dollars for it to make any sense. Minimum order size on gox is 0.01BTC, if you do the math you will see that your rebalancing orders would be too small by orders of magnitude.
member
Activity: 103
Merit: 10
December 17, 2013, 01:13:43 PM
I don't know what happened, but my instance isn't responding to the balance command (pressing b)
I tried using websocket and pubnub, tried a new API key and am up to date.

Does anybody how to solve this?

EDIT: I converted everything I got in my account (only 0.05BTC to test, maybe this isn't enough?) into BTC and as I pressed "b" after this, the bot rebalanced (it wasn't balanced before, but it wouldn't do it automatically).
New orders were placed and I will let it run through the night and see tomorrow Smiley
hero member
Activity: 588
Merit: 500
December 12, 2013, 02:39:03 PM
Please edit the goxtool.ini and set use_tonce=True (and while you are at it also set use_http_api=True). It seems that with my current implementation some API requests during initialization come out of chronological sequence, making some API requests fail sometimes but the "tonce" which is only requres a 10 second time window has not such strict requirements and stilll works.

I have made this the default for new installations now but existing installations will still have the old settings in the ini.

Edit: and please git pull once a day, I'm still not finished with the pubnub stuff, its still a huge mess, their python API is ugly and incomplete and therefore the goxtool side of this is a huge pile of workarounds, I am still trying to fix it and make it more elegant and more reliable.

Thanks, it's working now.
newbie
Activity: 6
Merit: 0
December 12, 2013, 05:39:21 AM
Thanks! Appreciate the work and quick turn around...  made the changes suggested and everything looks to be working. The account info is showing fine for me.
hero member
Activity: 938
Merit: 500
https://youengine.io/
December 12, 2013, 04:54:47 AM
Please edit the goxtool.ini and set use_tonce=True (and while you are at it also set use_http_api=True). It seems that with my current implementation some API requests during initialization come out of chronological sequence, making some API requests fail sometimes but the "tonce" which is only requres a 10 second time window has not such strict requirements and stilll works.

I have made this the default for new installations now but existing installations will still have the old settings in the ini.

Edit: and please git pull once a day, I'm still not finished with the pubnub stuff, its still a huge mess, their python API is ugly and incomplete and therefore the goxtool side of this is a huge pile of workarounds, I am still trying to fix it and make it more elegant and more reliable.
hero member
Activity: 588
Merit: 500
December 12, 2013, 03:26:25 AM
please

git pull


and then run with

--protocol=pubnub

still experimental because I coded it in a hurry but seems to work already


seems to work, but it doesn't show the account info @ the top.
hero member
Activity: 938
Merit: 500
https://youengine.io/
December 11, 2013, 06:24:00 PM
please

git pull


and then run with

--protocol=pubnub

still experimental because I coded it in a hurry but seems to work already
hero member
Activity: 588
Merit: 500
December 11, 2013, 05:31:26 PM
it seems to work when you switch to socketio instead of websocket.

EDIT: no it doesn't update anything then.
sr. member
Activity: 248
Merit: 252
1. Collect underpants 2. ? 3. Profit
December 11, 2013, 04:51:15 PM
Yes, MtGOX API has been down for several hours now. DDoS apparently.
legendary
Activity: 1176
Merit: 1010
Borsche
December 11, 2013, 04:45:52 PM
yes, it does not work anymore. not just for this bot, for anyone.
newbie
Activity: 6
Merit: 0
December 11, 2013, 03:48:35 PM
Anyone having problems connecting to the api?

i'm getting:

2013-12-11 12:45:46,705:DEBUG:goxapi.WebsocketClient:trying plain old Websocket: wss://websocket.mtgox.com?Channel=depth.BTCUSD/ticker.BTCUSD ...
2013-12-11 12:45:46,964:DEBUG:goxapi.WebsocketClient:WebSocketConnectionClosedException  reconnecting in 1 seconds...
2013-12-11 12:45:47,966:DEBUG:goxapi.WebsocketClient:trying plain old Websocket: wss://websocket.mtgox.com?Channel=depth.BTCUSD/ticker.BTCUSD ...

hero member
Activity: 938
Merit: 500
https://youengine.io/
December 10, 2013, 05:06:47 PM
hero member
Activity: 588
Merit: 500
December 10, 2013, 04:02:47 PM
I used to run this bot and I am curious how it did during all the recent market insanity.


This is what it should have done in the last 2 weeks: https://cryptotrader.org/backtests/fNnNrr3t7Yq5t57FD
You can see a small profit there.
member
Activity: 119
Merit: 100
December 10, 2013, 06:53:41 AM
I used to run this bot and I am curious how it did during all the recent market insanity.
Pages:
Jump to: