Preface

Clojure is a dynamic programming language with an emphasis on functional programming. As a functional language with immutability and laziness as the default, Clojure is well suited to financial modeling. Such languages help developers work at high-levels of abstraction, thus implementing features much more quickly and with more confidence, than is otherwise possible in languages without these facilities.

In this book, we will demonstrate Clojure's utility in processing and analyzing financial data. Whether it's core banking, risk assessment, compliance, or other domains, this book's audience mostly comprises finance professionals who can use Clojure to improve their Excel spreadsheets or existing toolsets.

What this book covers

Chapter 1, Orientation – Addressing the Questions Clojure Answers, gives you the background required to understand Clojure's utility to solve real-world problems in many domains, and finance in particular. It also orients and helps you understand Clojure's approach to computation.

Chapter 2, First Principles and a Useful Way to Think, provides you with an understanding of what a stream of stock price data may look like. It then applies some core functional programming features that Clojure provides to transform data into the stock price shape we desire.

Chapter 3, Developing the Simple Moving Average, aims to teach you how to translate requirements to data input, deriving the target data output, and reasoning about an equation needed to achieve your output. It also helps you understand Vars and bindings and how to implement a Simple Moving Average (SMA). This chapter focuses on developing a solid understanding of a problem, easily representing data, and quickly performing calculations.

Chapter 4, Strategies for Calculating and Manipulating Data, implements two more functions, the Exponential Moving Average (EMA) and Bollinger Band. These are both technical trading indicators, which involve more advanced mathematics. This chapter explores the math in each equation and the algorithmic steps needed to arrive at a desired endpoint.

Chapter 5, Traversing Data, Branching, and Conditional Dispatch, provides you with an understanding of more advanced branching and conditional logic. This chapter fleshes out the overall approach of Clojure's functions around recursion, list comprehensions, conditional dispatch, and first-order functions. This should then enable you to traverse and manipulate your data until you get what you want.

Chapter 6, Surveying the Landscape, takes a step back and reviews all of Clojure's features together. We'll review Clojure's scalars, collection types, and composite data types. Then, we'll take a look at how to use Clojure's functions to access, update, and compose data structures, I/O operations, and ways to approach what are known as side effects. We will also touch on Clojure's options when dealing with concurrency and parallelism.

Chapter 7, Dealing with Side Effects, shows how a componentized architecture can encapsulate all the functionality that we've developed so far. We will also develop a persistence strategy to write out our core tick list and accompanying analytics in the EDN format.

Chapter 8, Strategies for Using Macros, helps you understand how to read in data using Clojure. Once data is in our system, we will look at a few ways of querying it, including simple filtering and adding more constraints in a logical OR and AND fashion. We will also derive a a little query language using macros.

Chapter 9, Building Algorithms – Strategies to Manipulate and Compose Functions, uses all the knowledge you've gained so far to design buy and sell signals. It teaches you how to structure your data for further analysis, refactor your lagging indicator functions (SMA, EMA, and Bollinger Bands) to work lazily, and compose them together to get new information.

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

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