An algorithm that would demonstrate a semi-random function of a stock market in javascript.