Pages:
Author

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

legendary
Activity: 1792
Merit: 1008
/dev/null
May 14, 2013, 04:13:35 PM
#73
Well, at least with a larger % it doesn't go buy/sell crazy.  I'm adding about .016 BTC a day from my mining rigs (just some slower GPUs I happen to have, about 280 MH/s worth).

So about $100 worth would be a good start, as someone else mentioned?  Eventually I'll be able to get to about that amount, if Bitfloor ever gives me back my $.  Sad

I'm going to leave it running as is, since I'm just doing this for fun right now.

And it just started going nuts with orders again, so I upped it to 30%.
you wont make money, you will give your money to mtgox in form of fees...
full member
Activity: 224
Merit: 100
May 14, 2013, 03:46:20 PM
#72
Well, at least with a larger % it doesn't go buy/sell crazy.  I'm adding about .016 BTC a day from my mining rigs (just some slower GPUs I happen to have, about 280 MH/s worth).

So about $100 worth would be a good start, as someone else mentioned?  Eventually I'll be able to get to about that amount, if Bitfloor ever gives me back my $.  Sad

I'm going to leave it running as is, since I'm just doing this for fun right now.

And it just started going nuts with orders again, so I upped it to 30%.
hero member
Activity: 938
Merit: 500
https://youengine.io/
May 14, 2013, 11:54:27 AM
#71
It's not much.  About 0.036 BTC and $5.44.  It's been generating 0.01 buy/sell amounts.
This is not enough. 0.01 is the minimum order size at mtgox, the bot will adjust the order size to reach at least 0.01 and this is just too much for such a small account.
legendary
Activity: 1792
Merit: 1008
/dev/null
May 14, 2013, 11:47:21 AM
#70
It's not much.  About 0.036 BTC and $5.44.  It's been generating 0.01 buy/sell amounts.

Since I don't have much, I'm just "playing around" with it for now.  If I can ever get my cash out of Bitfloor, I'll likely put that back into BTC and add that in so that I'll have a bit more to work with.  I'd have between 0.75 and 1 BTC once I can do that.
with so few u waste your BTC @ fees. id say atleast 100$+
full member
Activity: 224
Merit: 100
May 14, 2013, 10:40:37 AM
#69
It's not much.  About 0.036 BTC and $5.44.  It's been generating 0.01 buy/sell amounts.

Since I don't have much, I'm just "playing around" with it for now.  If I can ever get my cash out of Bitfloor, I'll likely put that back into BTC and add that in so that I'll have a bit more to work with.  I'd have between 0.75 and 1 BTC once I can do that.
hero member
Activity: 938
Merit: 500
https://youengine.io/
May 14, 2013, 02:58:39 AM
#68
Not sure why, but I keep having to set the percentage higher to keep this from cycling endlessly selling and buying, as much as two or three times a second!

How much money do you have in your account, how big are the orders it generates?
full member
Activity: 224
Merit: 100
May 13, 2013, 05:55:11 PM
#67
Not sure why, but I keep having to set the percentage higher to keep this from cycling endlessly selling and buying, as much as two or three times a second!

I've set it for 23%, which seems ok for now.

Any idea why?  Is it due to the price being pretty volatile right now, since it seems they just came off another DDOS attack?
hero member
Activity: 938
Merit: 500
https://youengine.io/
May 10, 2013, 06:42:37 AM
#66
I was getting the same error with use_ssl=False, I switched it to True, now it's working again.

Yes, I can confirm this.

I just tried it and https API does not produce this error. So the workaround (or solution) is now to set use_ssl=True in the ini file and then --use-http will work again as before. Seems their anti-ddos web cache proxies have gone mad.
full member
Activity: 216
Merit: 100
May 10, 2013, 06:27:42 AM
#65
Is the bot currently broken? I only get "identification required to access private API". I didn't change anything, it just doesn't work anymore.
I was getting the same error with use_ssl=False, I switched it to True, now it's working again.
hero member
Activity: 938
Merit: 500
https://youengine.io/
May 10, 2013, 03:34:21 AM
#64
for me its working even with --use-http

Tnen cloudflare (or whatever anycasting web-proxy network they are using) must be messing it up. I'm located in Germany (Arcor / Vodafone).
legendary
Activity: 1792
Merit: 1008
/dev/null
May 10, 2013, 03:06:04 AM
#63
Is the bot currently broken? I only get "identification required to access private API". I didn't change anything, it just doesn't work anymore.

MtGox http api is broken again. As a woraround leave away the --use-http option (or if you have set it in yor ini then temporarily use the --no-http option) until they have fixed it again.

for me its working even with --use-http
hero member
Activity: 938
Merit: 500
https://youengine.io/
May 10, 2013, 03:03:23 AM
#62
Is the bot currently broken? I only get "identification required to access private API". I didn't change anything, it just doesn't work anymore.

MtGox http api is broken again. As a woraround leave away the --use-http option (or if you have set it in yor ini then temporarily use the --no-http option) until they have fixed it again.
hero member
Activity: 588
Merit: 500
May 10, 2013, 02:32:50 AM
#61
Is the bot currently broken? I only get "identification required to access private API". I didn't change anything, it just doesn't work anymore.
full member
Activity: 160
Merit: 100
May 08, 2013, 04:36:28 AM
#60
My thinking is as follows (in a quite generalized way), I get more profits doing 6 trades with 2$ profit each time than only 1 trade with $10 profit. Can we come up with a optimum distance level given a portfolio?

Its not a function of the portfolio size. The profit per trade is a function of distance d and fees f (f = 2*0.6 = 1.2 at MtGox). Lets first only look at the ideal situation with zero fees for smplicity, then the profit for one trade would be proportional to .

The number of trades n that happen during a fixed time period is also a function of the distance, lets call this n(d). So the profit would be

p(d) ~ d² * n(d)

and with fees it would be:

p(d) ~ (d-f) * d * n(d)

And now we need to know how exactly does n(d) look like? Does it have an 1/d² somewhere? I don't know it. We need to simulate it with real historical bitcoin market data (and maybe also with data from other markets). Maybe someone wants to volunteer and make a quick python (or other) script to simulate it on old data and then run it with a lot of distances (and different MtGox fees) (and over a time period where start price and end price are not too far away) and then plot a few curves:

overall profit vs. distance
number of trades vs. distance
etc.

I was hoping BTC-Engineer would come back and share his results and do more simulations but if he wont come back I will probably do it myself but I'm lazy and probably someone else will do it earlier (and hopefully post his results here)

I looked at this before, oddly enough. The size of order follows, roughly, a Pareto distribution. That is, a 1 coin bid is roughly equally likely as a 10 coin as a 100 coin, in a given time period.

There are caveats: I looked at a lot of historical data, so it may be a function of bitcoins being cheaper in the past (so then larger trades in bitcoin terms).

Also, integer trades are much more likely; 1 btc much more than 1.01 and 10 more than 9.7 for example.

Ignoring the integer size preference, I fitted a curve to the trade size data. Where f(x) is the probability that the trade size is greater than x bitcoins,
Code:
f=1-(0.1/x)^2.

So the probability of execution at a price is
Code:
p(price)=min( 1, f(s + bid_size) )
where s is the cumulative bids (i.e. depth) at that price.

You can validate f(x) with the following matlab code:
Code:
% empiral data on probability of trade at size
trades=csvread('../data/recent_trades.csv');
[F,X]=ecdf(trades(:,3));
   
In the end, I don't really use this information in my strategy. I don't think your bots performance under a balancing strategy is that sensitive to where you place the orders, if they are in a reasonable range. I would strongly echo prof7bit's warning about placing them too close together, though. This is because of fees.
hero member
Activity: 938
Merit: 500
https://youengine.io/
May 07, 2013, 01:02:11 PM
#59
My thinking is as follows (in a quite generalized way), I get more profits doing 6 trades with 2$ profit each time than only 1 trade with $10 profit. Can we come up with a optimum distance level given a portfolio?

Its not a function of the portfolio size. The profit per trade is a function of distance d and fees f (f = 2*0.6 = 1.2 at MtGox). Lets first only look at the ideal situation with zero fees for smplicity, then the profit for one trade would be proportional to .

The number of trades n that happen during a fixed time period is also a function of the distance, lets call this n(d). So the profit would be

profit(d) ~ d² * n(d)

and with fees it would be:

profit(d) ~ (d-f) * d * n(d)

And now we need to know how exactly does n(d) look like? Does it have an 1/d² somewhere? I don't know it. We need to simulate it with real historical bitcoin market data (and maybe also with data from other markets). Maybe someone wants to volunteer and make a quick python (or other) script to simulate it on old data and then run it with a lot of distances (and different MtGox fees) (and over a time period where start price and end price are not too far away) and then plot a few curves:

overall profit vs. distance
number of trades vs. distance
etc.

I was hoping BTC-Engineer would come back and share his results and do more simulations but if he wont come back I will probably do it myself but I'm lazy and probably someone else will do it earlier (and hopefully post his results here)
full member
Activity: 216
Merit: 100
May 07, 2013, 11:20:04 AM
#58
Quote
DISTANCE = 3 is very low. Its extremely low, given how the order lag can spike on mtgox when there is much activity and price is moving fast. You will inevitably run into problems with such an extremely low distance. I have set mine to 11 now (because 7 was still too small) and it will trade only a few times per week (and on crazy days that happen every once in a while it might trade a few times a day). The larger the distance the fewer trades it will do, the less problems you will have and the less fees you pay to MtGox (and therefore more profit for you). With DISTANCE=11 I can leave it running unattended for days and can sleep well without worrying.

prof, I'm experimenting with DISTANCE=2. I know it's s very small distance but it seems working fine even with a lag up to 60 seconds. My thinking is as follows (in a quite generalized way), I get more profits doing 6 trades with 2$ profit each time than only 1 trade with $10 profit. Can we come up with a optimum distance level given a portfolio?
hero member
Activity: 938
Merit: 500
https://youengine.io/
May 07, 2013, 07:53:31 AM
#57
I have running it now a few days and it made no trades...

It does not suddenly begin to "trade". It places 2 limit orders above and below immediately after you initialized it according to the instructions (no need to wait here, you can see that it worked immediately) and then it waits for market to move there and fill one of them. Please read the description and the source code and also insert self.debug() statements at all the places where you are unsure what exactly is happening to learn what the values of the variables are and why it won't work as expected.

If you followed the instrucions then it has placed 2 orders (you see them with F6 or if you zoom out the order book or by looking at the mtgox.com trading web interface). You just have to wait until price moves to fill one of these orders. Then when this happens it will automatically cancel the other remaining order and place 2 new orders above and below. You may not have any other open orders in your account (whose price ends with the MARKER digit) or it will confuse the bot and it wont operate correctly. Also if account balance suddenly changes due to other trading it will confuse the bot and its calculations.

Look at your open orders and cancel or change all orders that have a price ending with 7. If you really need a permanent order to buy a million BTC at $0.00007 in case MtGox gets hacked again then either change this order to $0.00008 or alternatively change the MARKER value to some other number between 1 and 9 that is not used by you, then manually cancel all wrong orders (F6) and reload and reinitialize according to instrutions in post #1.
hero member
Activity: 938
Merit: 500
https://youengine.io/
May 07, 2013, 07:48:56 AM
#56
I just installed this bot and set the distance to 3.
I rebalanced and then when I hit p it places orders correctly.

I'm seeing the sell orders go through, but the bot doesn't then place a new order at that point. I'm I right in thinking that this is incorrect behavior? There is a single bid order left in my mtgox account..

Is it due to this?

Code:
Code:
   # as long as there are ANY pending orders around we
   # just do nothing and wait for the next signal
   if count_pending:
            return

The following would be correct behavior: If there is only one order left it will cancel that order and then place 2 new orders above and below the new center. (The center is calculated from the account balance, not the price of the last trade but usually it differs only a few cents, the center is the BTCUSD price at which perfect balance would be established).

If you see anything other than exactly 1 bid and 1 ask order  then there is something wrong. If there is only one existing order left and it does not attempt to trade then here is something wrong.

The code snipped you cited makes it wait until there is no more pending order left, this is important, otherwise it would not work at all and probably burn a lot of money! Orders can be pending for several seconds up to many minutes, depending how high the order lag is, the bot will not try to place more orders or do anything as long as there are stlll pending orders in the pipeline, just wait (the o_lag display at the top gives you a hint how much order lag there is currently)

DISTANCE = 3 is very low. Its extremely low, given how the order lag can spike on mtgox when there is much activity and price is moving fast. You will inevitably run into problems with such an extremely low distance. I have set mine to 11 now (because 7 was still too small) and it will trade only a few times per week (and on crazy days that happen every once in a while it might trade a few times a day). The larger the distance the fewer trades it will do, the less problems you will have and the less fees you pay to MtGox (and therefore more profit for you). With DISTANCE=11 I can leave it running unattended for days and can sleep well without worrying.
full member
Activity: 216
Merit: 100
May 07, 2013, 07:36:42 AM
#55
Is the goxtool keeps getting stuck today? Or it 's just me and my system?

It's been working OK for me for 2 days. I'm using websocket.
legendary
Activity: 2955
Merit: 1049
May 07, 2013, 07:30:28 AM
#54
Is the goxtool keeps getting stuck today? Or it 's just me and my system?
I have running it now a few days and it made no trades...
Pages:
Jump to: