O'Reilly logo

Clojure for Finance by Timothy Washington

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Knowing the data input

When we completed Chapter 2, First Principles and a Useful Way to Think, we had helper functions that generated some test time series data for us. So, our input data will look something like the following output. This is just a lazy sequence of maps. Each map has two entries with the keys, last-trade-price and last-trade-time. The fact that the input data is a lazy sequence is important. It means we can treat it as infinite, so it can be consumed as the data comes in:

({:last-trade-time #inst "2015-09-24T04:13:13.868-00:00", :last-trade-price {:last 5.466160487301605}} {:last-trade-time #inst "2015-09-24T04:13:15.868-00:00", :last-trade-price {:last 6.540895364039775}} {:last-trade-time #inst "2015-09-24T04:13:16.868-00:00", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required