- This program simulates Mr. Ace's playing of the stock market, as described in the book, where he must stop after a number of days you specify by "Number of days." You also specify the "Number of trials" for the simulation. Without loss of generality, we let the book's V = 0. The program prints out and returns Mr. Ace's net gain after the n days, and plots the points (x, f(x)) for x = 0 to n, where x is the number of the day, and f(x) is the value of V on day x. The points are connected with lines: dotted lines indicate time during which Mr. Ace holds stock under his system; unbroken lines indicate time during which he does not hold stock.


The source.
StockGraph.java