Gary,
The winning algorithm is allowed to invest as much or as little of the $100,000 that it wishes.
If the total value of the assets being managed by the algorithm (cash - short positions + long positions + unrealized gain - unrealized loss) drops below $90,000, we will stop the algorithm.
For example, let's say the algorithm takes the following positions the first day it runs and then holds them:
- $50,000 cash
- short 1,000 shares of stock A, originally shorted at $10 per share
- short 1,000 shares of stock B, originally shorted at $10 per share
- long 2,500 shares of stock C, originally bought for $10 per share
- long 2,500 shares of stock D, originally bought for $10 per share
Let's simplify by ignoring the cost of borrowing the A and B shares to short them, though obviously in real life that cost would obviously have an impact on the algorithm's performance.
But let's say, instead, that though the value of stocks B, C, and D don't change, the price of stock A suddenly doubles to $20. The total value of all the assets being managed by your algorithm is now $90,000, because you now have a short exposure of $10,000 in stock A (($20/share current value - $10/share short price) * 1,000 shares). At that point we would stop the algorithm and liquidate all of its holdings.
Similarly, let's say that the value of stocks A, B, and C remain constant, but the price of stock D suddenly drops to $6. Your total asset value is, again, now $90,000, because you've suffered a loss of $10,000 on stock D (($10/share purchase price - $6/share current value) * 2,500 shares). Again, at that point we would stop the algorithm and liquidate all of its holdings.
I've given examples which assume three stable stocks and one moving stock, but of course all of the stocks are likely to move in value. In this particular example the total asset value of your account at any given time would be:
[ NOTE: Edited because I got the formulas slightly wrong when I first posted this.]
$50,000 + ($10 - stock A current price) * 1,000 + ($10 - stock B current price) * 1,000 + stock C current price * 2,500 + stock D current price * 2,500
If the value of this expression ever drops below $90,000, then we stop the algorithm and liquidate all its holdings.
To make it slightly more realistic, we can put back the cost of shorting he stock that I omitted for the sake of the simple examples:
$50,000 - fees charged by IB to date to short A and B + ($10 - stock A current price) * 1,000 + ($10 - stock B current price) * 1,000 + stock C current price * 2,500 + stock D current price * 2,500