While the sine function has so far given us the most amount of control, there are properties of all those functions that would be nice to incorporate into our stream of price data. What we will aim for is to randomly include data samples from the sine, polynomial, and oscillating stochastic functions.

To do this, we'll need a way to mark the start and end of each cycle or phase of a graph. This at least applies to the polynomial and sine functions, and not to the oscillating stochastic one. In order to find the phase of the first two functions, we'll need to determine the *x* intercepts of each one. There's a mathematical way of determining both. However, we'll use a different algorithmic approach that employs Clojure's ...

Start Free Trial

No credit card required