Summary

In this chapter, we built on the simple-moving-average function using the more advanced partition Clojure data transformation function. Vars, binding, and lazy sequences helped us organize our expressions. And our function design was guided by the data input and desired data output. The goal here is to form a solid understanding of a problem, easily represent data, and quickly perform calculations. From our basic tick list, we were able to (from a starting point) calculate the average price at each point up to the current price. We did this by slicing or partitioning our list so that each price point had a history of the previous 20 price points. These are the kinds of functions that will empower us to manipulate and shape our data. We'll take the lessons we've learned in this chapter to the next chapter and implement a slightly more advanced algorithm—the exponential moving average.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.221.133