So I've wanted to code this up for a while now: It's a simple Monte Carlo system which generates a bunch of track records given your algo's win rate and how much it gains on a win/loses on a loss.
Playing around with the values really gives a "hands on" feel for how even a perfectly good algo can do based on good/bad luck. It's always a surprise that even with 250 trades and a >50% chance of winning, there is a not-insignificant chance of ending up worse than where you started.
By using a fixed fraction of the portfolio in the simulation, its really very difficult to lose all your investment, because by definition you are only investing a fixed percentage of it every trade. In reality it is possible because companies go bankrupt, shares stop trading, etc.
If an algo is setup to use fixed dollar amounts to invest per trade, then your risk of ruin goes up simply based on the possibility of getting X losing trades in a row. e.g. investing $5000 on each trade of a $100,000 account leaves you open to a 20-run of losses for complete ruin, and this is nowhere near as crazy unlikely as it may seem.