I'm interested in learning about algorithmic trading, particularly in bitcoin.

Looking at this chart, I can see that I could simultaneously offer a bid that was slightly higher than the highest bid, and an ask that was slightly lower than the current lowest ask.

Whenever anyone bought or sold, that would mean that I would always be one of the people they bought/sold from/to. This would allow me to make a profit equal to the gap between the two.

The problem I'm having is in calculating the risks. As far as I can tell the variables involved are:

Variables out of my control

- Gap between highest bid and ask offered by others
- Average price paid for "pot" of BTC that I'm trading with
- Some measure of the volatility of prices over the preceding period (Risk)
- How much volume would move the market by a given amount higher or lower

Variables within my control

- Maximum exposure in terms of money
- Maximum difference in ratio between GBP reserve and BTC reserve
- Size of the gap between my bid/ask prices (out from the exact centre as percentage of total gap)

I'm struggling to figure out how to model this effectively though. I studied Computer Science and have a basic grasp of probability theory, but this is a bit beyond me. Any help, or pointers to the "proper" formula to model this would be greatly appreciated.