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
d².
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,
So the probability of execution at a price is
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:
% 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.