Here is my shot at doing Historical Simulation to find the Value at Risk of your portfolio.
Due to the method it is not a great method for risk management - but can get you in the ball park.
i.e. aiming for a 5% VaR level - I found the predicted VaR was exceeded between 1-10% of the time.
This could be handy in allocating capital to algorithms proportional some multiple of the VaR value in order to limit losses.