Reinforcement Learning (RL) has experienced significant advancement over the past decade, prompting a growing interest in applications within finance. This survey critically evaluates 167 publications, exploring diverse RL applications and frameworks in finance. Financial markets, marked by their complexity, multi-agent nature, information asymmetry, and inherent randomness, serve as an intriguing test-bed for RL. Traditional finance offers certain solutions, and RL advances these with a more dynamic approach, incorporating machine learning methods, including transfer learning, meta-learning, and multi-agent solutions. This survey dissects key RL components through the lens of Quantitative Finance. We uncover emerging themes, propose areas for future research, and critique the strengths and weaknesses of existing methods.
Thursday, May 8. 2025
Evolution of Reinforcement Learning in Quantitative Finance: A Survey
LLM4FTS: Enhancing Large Language Models for Financial Time Series Prediction
LLM4FTS: Enhancing Large Language Models for Financial Time Series Prediction
Predicting financial time series presents significant challenges due to inherent low signal-to-noise ratios and intricate temporal patterns. Traditional machine learning models exhibit limitations in this forecasting task constrained by their restricted model capacity. Recent advances in large language models (LLMs), with their greatly expanded parameter spaces, demonstrate promising potential for modeling complex dependencies in temporal sequences. However, existing LLM-based approaches typically focus on fixed-length patch analysis due to the Transformer architecture, ignoring market data's multi-scale pattern characteristics. In this study, we propose $LLM4FTS$, a novel framework that enhances LLM capabilities for temporal sequence modeling through learnable patch segmentation and dynamic wavelet convolution modules. Specifically,we first employ K-means++ clustering based on DTW distance to identify scale-invariant patterns in market data. Building upon pattern recognition results, we introduce adaptive patch segmentation that partitions temporal sequences while preserving maximal pattern integrity. To accommodate time-varying frequency characteristics, we devise a dynamic wavelet convolution module that emulates discrete wavelet transformation with enhanced flexibility in capturing time-frequency features. These three modules work together to improve large language model's ability to handle scale-invariant patterns in financial time series. Extensive experiments on real-world financial datasets substantiate the framework's efficacy, demonstrating superior performance in capturing complex market patterns and achieving state-of-the-art results in stock return prediction. The successful deployment in practical trading systems confirms its real-world applicability, representing a significant advancement in LLM applications for financial forecasting.
Sunday, January 14. 2024
Trading Evaluation
StockFormer: A Swing Trading Strategy Based on STL Decomposition and Self-Attention Networks
Amidst ongoing market recalibration and increasing investor optimism, the U.S. stock market is experiencing a resurgence, prompting the need for sophisticated tools to protect and grow portfolios. Addressing this, we introduce "Stockformer," a cutting-edge deep learning framework optimized for swing trading, featuring the TopKDropout method for enhanced stock selection. By integrating STL decomposition and self-attention networks, Stockformer utilizes the S&P 500's complex data to refine stock return predictions. Our methodology entailed segmenting data for training and validation (January 2021 to January 2023) and testing (February to June 2023). During testing, Stockformer's predictions outperformed ten industry models, achieving superior precision in key predictive accuracy indicators (MAE, RMSE, MAPE), with a remarkable accuracy rate of 62.39% in detecting market trends. In our backtests, Stockformer's swing trading strategy yielded a cumulative return of 13.19% and an annualized return of 30.80%, significantly surpassing current state-of-the-art models. Stockformer has emerged as a beacon of innovation in these volatile times, offering investors a potent tool for market forecasting. To advance the field and foster community collaboration, we have open-sourced Stockformer, available at StockFormer
CRISIS ALERT:Forecasting Stock Market Crisis Events Using Machine Learning Methods
Historically, the economic recession often came abruptly and disastrously. For instance, during the 2008 financial crisis, the SP 500 fell 46 percent from October 2007 to March 2009. If we could detect the signals of the crisis earlier, we could have taken preventive measures. Therefore, driven by such motivation, we use advanced machine learning techniques, including Random Forest and Extreme Gradient Boosting, to predict any potential market crashes mainly in the US market. Also, we would like to compare the performance of these methods and examine which model is better for forecasting US stock market crashes. We apply our models on the daily financial market data, which tend to be more responsive with higher reporting frequencies. We consider 75 explanatory variables, including general US stock market indexes, SP 500 sector indexes, as well as market indicators that can be used for the purpose of crisis prediction. Finally, we conclude, with selected classification metrics, that the Extreme Gradient Boosting method performs the best in predicting US stock market crisis events.
Monday, July 10. 2023
Market Making with Deep Reinforcement Learning from Limit Order Books
Market Making with Deep Reinforcement Learning from Limit Order Books
Market making (MM) is an important research topic in quantitative finance, the agent needs to continuously optimize ask and bid quotes to provide liquidity and make profits. The limit order book (LOB) contains information on all active limit orders, which is an essential basis for decision-making. The modeling of evolving, high-dimensional and low signal-to-noise ratio LOB data is a critical challenge. Traditional MM strategy relied on strong assumptions such as price process, order arrival process, etc. Previous reinforcement learning (RL) works handcrafted market features, which is insufficient to represent the market. This paper proposes a RL agent for market making with LOB data. We leverage a neural network with convolutional filters and attention mechanism (Attn-LOB) for feature extraction from LOB. We design a new continuous action space and a hybrid reward function for the MM task. Finally, we conduct comprehensive experiments on latency and interpretability, showing that our agent has good applicability.
Friday, March 11. 2022
Deep Learning for Sequences in Quantitative Finance
From the description of a talk 'March 16 Talk, "Deep Learning for Sequences in Quantitative Finance" with David Kriegman of UCSD and Two Sigma', an excellent summary:
The quantitative investment process can be viewed as one that takes in raw data at one end and executes trades that buy and sell financial instruments at the other end. The process naturally decomposes into steps of feature extraction, forecasting the returns of individual instruments, portfolio allocation to decide quantities to trade, and trading execution. Many of the steps in this process are readily expressed as machine learning problems that can be addressed using deep learning sequence methods.
Thursday, February 28. 2019
Company Valuation
Somewhere in the Globe and Mail:
All things being equal – such as revenue, number of employees – the value of a product company that owns intellectual property (IP) is four times that of a similar service company. Generally speaking, an investor will value a service-based company at one to two times its revenue, while product-based companies are valued at four to 10 times.
Thursday, July 19. 2018
Gold
Prelude To A 2008 Event: Paper Gold Manipulation Intensifies
And has anyone checked gold lease rates lately? Currently the lease rate curve for gold and silver in London is inverted. In fact, lease rates gold from 3 months to a year are negative. Negative lease rates mean the Central Banks will pay bullion banks to lease gold and silver. Long-timers like me know that this means there’s an immediate and anticipated shortage of physical gold and silver available for delivery, where “delivery” means the metal is removed from the London vaults and shipped to the entitled buyer.
Both gold and silver are backwardated. It took 11 iterations in the LBMA p.m. fix on Tuesday to balance out the heavy demand for physical gold from bidders. 11 iterations is rare occurrence. 5-6 iterations is rare. 1 or 2 is typical. Metal is tight in London.
If you are monitoring the Comex Hong Kong kilo bar vaults, you are aware that the movement in and out of the vaults there suggests that metal is also tight in Hong Kong, which means it is likely tight in Shanghai.
Saturday, January 27. 2018
Mining BitCoin
Some Links
- Mining Bitcoin with a GPU in 2018
- Goodbye Banner Ads. Hello Oyster.
- PimpOs
- 2018/03/17: Bitcoin mining - some tech details
- 2019/02/25 Option Miners
Saturday, October 14. 2017
Securities Trading Applications
With a 'kind of' open source bent, but not really, but have some merit for latent information, some tabs I've had open in my browser:
- Open Source Hedge Fund with some tools and data sources and strategies for trading, but it does have a page for Getting Started: Building a Fully Automated Trading System.
- Sentosa – An Open Source High Frequency Automatic Algorithmic Trading System and Research Platform but the site and the code don't seem to be receiving much maintenance, but does have a repository of strategy ideas.
- Zorro Trading - a basic technical analysis based trading engine, but has some ideas to which I aspire.
With a plug to my own code in progress: Trade Frame.
Sunday, July 24. 2016
trade-frame: c++ securities trading software development framework
I have been working on some C++ trading code off and on for quite some time to test various trading scenarios and strategies. And to see just how random the market really is... (it is).
Rather than keep it to my self, well probably I'll be the only one to continue to use it, but maybe there are others out there who might be able to use some of this, rather than build everything from scratch, like probably so many others have.
This software knows how to read live execution data (quotes and trades) from DTN IQFeed and from Interactive Brokers. It also knows how to submit orders to Interactive Brokers, and to tally up the results in terms of commissions, spreads, and profit analysis.
I have written a bunch of libraries, and those libraries are in use by my primary application: ComboTrading. This application will allow me to create various options combinations, track them in terms of their composite value (price and volatility wise), and initiate auto entries and exits based upon simple rule sets.
The repository is at Github: trade-frame. I use NetBeans as my IDE for development.
There are a number of libraries on which the code depends. My script, libs-build, also on Github, can be used to download and build the trading library dependencies.
Sunday, May 25. 2014
Financial Nuggets
Found in John Mauldin's 'Thoughts From The FrontLine', a nice definition of macro-economic terms and their relationships:
"Hunt explains that the monetary policy cannot influence the economy unless the market rate of interest (represented by the Baa corporate bond yield) is below the natural rate of interest (the nominal rate of GDP growth)" -- May 25, 2014.