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", :last-trade-price {:last 5.53301182972796}} {:last-trade-time #inst "2015-09-24T04:13:17.868-00:00", :last-trade-price {:last 5.827927905654936}} {:last-trade-time #inst "2015-09-24T04:13:19.868-00:00", :last-trade-price {:last 6.31043832017862}} {:last-trade-time #inst "2015-09-24T04:13:21.868-00:00", :last-trade-price {:last 7.1373823393671865}} {:last-trade-time #inst "2015-09-24T04:13:24.868-00:00", :last-trade-price {:last 8.564858807240624}} {:last-trade-time #inst "2015-09-24T04:13:24.868-00:00", :last-trade-price {:last 10.277830568688747}} {:last-trade-time #inst "2015-09-24T04:13:25.868-00:00", :last-trade-price {:last 8.222264454950999}} {:last-trade-time #inst "2015-09-24T04:13:28.868-00:00", :last-trade-price {:last 9.866717345941199}} ... )
Here's a sample graph output (your data may vary):
3.17.79.206