@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir for analyzing financial data. This book leans on many of the latest computation-heavy libraries like Nx, Scholar and Explorer so you can analyze financial time series data. We also make extensive use of Livebook and Vega-Lite so that you can visualize your results. Livebook also makes it so that you can tie all these tools together and quickly build UIs to make the exploration of financial data more enjoyable!
Throughout this book you will learn how to:
Fetch and analyze real economic data from the FRED API
Pull down the latest stock market data from Yahoo! Finance
Calculate risk and return for your portfolio across stocks, crypto, and commodities
Build technical trading indicators and backtest them against actual market history
Map risk-return tradeoffs and evaluate portfolio diversification
By the end of the book, you will have a better understanding as to how the financial markets operate and how to analyze them your favorite programming language!
Part I: Augmenting Financial Intelligence with Elixir
The Elixir Programming Language
Finance is All Around Us
Overview of the Various Asset Classes
Stock Market Booms and Busts
US Market Indices
US Housing Data
Commodity Prices
Covid-19 and the “Top 1%” of Wealthy Investors’ Holdings
Technology in Finance
Establishing Elixir Framework for Stock Data
Part II: Under the Hood: Portfolio and Risk Management in Action
Portfolio Analytics and Benchmarking
Constructing and Calculating an Index
Is Diversification Worth It?
Part III: Technical Analysis and Market Timing with Elixir
Trading Strategies for Timing Markets
Backtesting Trading Strategies
Part IV: Advanced Topics in Regression Modeling and Risk Management
Mapping Risk-Return Trade-Offs Across Markets
Concluding Remarks And Your Future Journey
Check out the book landing page for more details and to see how you can buy the book at 20% off while we’re in beta:
Awesome . I’ve been playing around with automated trading algorithms using Elixir + ZeroMQ + MetaTrader5, so this book with definitely help in analyzing market data and build optimized trading systems.
I too have a healthy dose of skepticism when it comes to these things lol. The reason it is a zip is because the free sample contains the epub, pdf, and Livebook notebooks and zipping it was the easiest way to distribute all the files in one bundle.
I just downloaded the free sample zip from ConvertKit to make sure they don’t stuff anything else in there. Everything in there is what we intended to bundle:
While we don’t get into stream processing of data in this book, you can definitely apply what we teach you to stream processing time seriesy data. Not to mention, all the Nx tools and Explorer are wicked fast so you should have no problem appending data to a DataFrame for example and rerunning analysis .
I think need to add stream processing, your book in financial domain with machine learning is interesting. Do you have plan to publish on Pragprog.com ?
This sure looks like an awesome read. I did submit my email so that I can peruse through the free chapters before making a purchase decision but I’m yet to receive the free chapters bundle in my email. Isn’t this unusual? How else can I access the free bundle?
Got the beta and right now its not worth it. For me personally, price to elixir tricks value is much less compared to pragprog books. Hope final release will be better.
I definitely appreciate the candid feedback. Can you expand upon “price to elixir tricks value is much less compared…”? I’m not following what you mean by this?
Book looks great. I want to like Nx, but my experience with Nx is terrible running over GPUs:
could not compile dependency :exla, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile exla --force", update it with "mix deps.update exla" or clean it with "mix deps.clean exla"
Ollama is bomber - never never fails. Nx never works out-of-the-box. The decision to rely on Exla should be revisited. Getting Exla/Nx running is black magic, I’ll bet it has terrible consequences for Nx adoption. A shame Exla installation is so terrible - once beyond that gauntlet the Nx toolchain is super nice.
This book seems very US-centric. Having very little knowledge of markets or trading myself, do the ideas in the book extend to other markets/countries? Appreciate that if you don’t have experience with other markets/countries that perhaps you can’t answer this.
In the book we lean on the EXLA and I haven’t had issues with it either on Linux or Mac when configuring the compiler for :host. I have been meaning to try out GitHub - ausimian/emily: Elixir bindings and Nx backend for Apple MLX · GitHub to make use of MLX on my Apple hardware, but haven’t had the chance yet. If I had any CUDA hardware I could probably share your pain .
Good question! We focus on US time series data since it is what we easily had access to. I created and published 2 open source libraries to make that easier for book readers (and anyone really that wants to play with stock/economic data):
That being said, the techniques covered in the book can be applied to any stock time series data. So if you have an alternative data source and can massage the data, the techniques covered in this book are just as applicable.
Yes, :host mode is reliable. I hope the MLX backend is successful. The dominance of CUDA is a head-scratcher! Ollama makes it work by embedding CUDA in the app. Bulletproof!! EXLA should consider that approach. Two developments make CUDA/Nx somewhat less painful 1) Ubuntu 26.04 is the first Ubuntu to natively distribute CUDA. sudo apt install cuda - OMG yes! 2) Claude has proven effective at debugging cuda drivers and EXLA compile issues.