This is a simple algorithm to simulate a random walk of a stock based on historical data
Based on historical data it calculated the step size in both directions with the propability of going up or down being 50%.
The needed .csv files can(should) be downloaded here: https://de.finance.yahoo.com/