Modern financial markets are complex and adaptive systems in which heterogeneous participants - retail investors, institutional and pension funds, market makers, and high-frequency traders - interact continuously through electronic trading mechanisms, most notably the Limit Order Book (LOB). While the Efficient Market Hypothesis posits that prices fully reflect available information, the Grossman-Stiglitz paradox argues that a certain degree of market inefficiency is structurally necessary. In this context, quantitative trading strategies seek to identify and exploit such inefficiencies. A central obstacle in algorithmic trading research is the simulation-to-reality gap: historical backtesting fails to capture the dynamic market response to new orders, making performance estimates potentially unreliable. The first part of the thesis addresses this limitation by adopting ABIDES (Agent-Based Interactive Discrete Event Simulator), a flexible agent-based framework capable of reproducing realistic microstructure dynamics through heterogeneous interacting agents. Within this environment, the second main block of the work applies Reinforcement Learning (RL) techniques to the problem of algorithmic trading. Agents are trained via Proximal Policy Optimization (PPO) under reward functions designed to model different degrees of risk aversion, and the relationship between reward specification, trading behavior, profitability, and risk management is analyzed systematically. Building on the trained agents, the third and final part of the thesis investigates the Inverse Reinforcement Learning (IRL) problem: given observed trading decisions, can the underlying reward function be recovered? This is addressed through gradient-based IRL methods - specifically GIRL and Σ-GIRL - which exploit policy gradient estimates to reconstruct reward feature weights from expert demonstrations alone. The recovered reward function is then used to retrain agents in a new market regime, where its generalization capabilities are assessed against behavioral cloning baselines. This work represents a first step toward modeling the latent objectives of market participants from observed behavior.

I mercati finanziari moderni sono sistemi complessi e adattativi in cui partecipanti eterogenei - investitori retail, fondi istituzionali e pensionistici, market maker e high-frequency trader - interagiscono continuamente attraverso meccanismi di negoziazione elettronica, in particolare il Limit Order Book (LOB). Mentre l'Ipotesi dei Mercati Efficienti sostiene che i prezzi riflettano pienamente tutte le informazioni disponibili, il paradosso di Grossman-Stiglitz afferma che un certo grado di inefficienza sia strutturalmente necessario; in questo contesto, le strategie di trading quantitativo mirano a identificare e sfruttare tali inefficienze. Un ostacolo centrale è il cosiddetto simulation-to-reality gap: il backtesting storico non cattura la risposta dinamica del mercato ai nuovi ordini, rendendo le stime di performance potenzialmente inaffidabili. La prima parte della tesi affronta questo limite adottando ABIDES (Agent-Based Interactive Discrete Event Simulator), un simulatore agent-based capace di riprodurre dinamiche realistiche di microstruttura attraverso agenti eterogenei interagenti. Il secondo blocco applica tecniche di Reinforcement Learning (RL) al trading algoritmico: gli agenti vengono addestrati tramite algoritmo PPO con funzioni di ricompensa che modellano diversi gradi di avversione al rischio, analizzando sistematicamente la relazione tra reward, comportamento, redditività e gestione del rischio. La terza parte indaga il problema dell'Inverse Reinforcement Learning (IRL): date le decisioni osservate, è possibile recuperare la funzione di ricompensa sottostante? Il problema viene affrontato tramite GIRL e Σ-GIRL, metodi basati sul gradiente di policy che ricostruiscono i pesi della reward da dimostrazioni esperte. Le funzioni di ricompensa ricostruite vengono quindi utilizzate per riaddestrare gli agenti in un nuovo regime di mercato, nel quale le capacità di generalizzazione vengono valutate confrontandole con la baseline di behavioral cloning. Questo lavoro rappresenta un primo passo verso la modellazione degli obiettivi latenti dei partecipanti al mercato a partire dal comportamento osservato.

Inferring risk aversion in algorithmic trading: an inverse reinforcement learning approach within an agent-based LOB Simulator

Garagiola, Stefano
2025/2026

Abstract

Modern financial markets are complex and adaptive systems in which heterogeneous participants - retail investors, institutional and pension funds, market makers, and high-frequency traders - interact continuously through electronic trading mechanisms, most notably the Limit Order Book (LOB). While the Efficient Market Hypothesis posits that prices fully reflect available information, the Grossman-Stiglitz paradox argues that a certain degree of market inefficiency is structurally necessary. In this context, quantitative trading strategies seek to identify and exploit such inefficiencies. A central obstacle in algorithmic trading research is the simulation-to-reality gap: historical backtesting fails to capture the dynamic market response to new orders, making performance estimates potentially unreliable. The first part of the thesis addresses this limitation by adopting ABIDES (Agent-Based Interactive Discrete Event Simulator), a flexible agent-based framework capable of reproducing realistic microstructure dynamics through heterogeneous interacting agents. Within this environment, the second main block of the work applies Reinforcement Learning (RL) techniques to the problem of algorithmic trading. Agents are trained via Proximal Policy Optimization (PPO) under reward functions designed to model different degrees of risk aversion, and the relationship between reward specification, trading behavior, profitability, and risk management is analyzed systematically. Building on the trained agents, the third and final part of the thesis investigates the Inverse Reinforcement Learning (IRL) problem: given observed trading decisions, can the underlying reward function be recovered? This is addressed through gradient-based IRL methods - specifically GIRL and Σ-GIRL - which exploit policy gradient estimates to reconstruct reward feature weights from expert demonstrations alone. The recovered reward function is then used to retrain agents in a new market regime, where its generalization capabilities are assessed against behavioral cloning baselines. This work represents a first step toward modeling the latent objectives of market participants from observed behavior.
ING - Scuola di Ingegneria Industriale e dell'Informazione
22-lug-2026
2025/2026
I mercati finanziari moderni sono sistemi complessi e adattativi in cui partecipanti eterogenei - investitori retail, fondi istituzionali e pensionistici, market maker e high-frequency trader - interagiscono continuamente attraverso meccanismi di negoziazione elettronica, in particolare il Limit Order Book (LOB). Mentre l'Ipotesi dei Mercati Efficienti sostiene che i prezzi riflettano pienamente tutte le informazioni disponibili, il paradosso di Grossman-Stiglitz afferma che un certo grado di inefficienza sia strutturalmente necessario; in questo contesto, le strategie di trading quantitativo mirano a identificare e sfruttare tali inefficienze. Un ostacolo centrale è il cosiddetto simulation-to-reality gap: il backtesting storico non cattura la risposta dinamica del mercato ai nuovi ordini, rendendo le stime di performance potenzialmente inaffidabili. La prima parte della tesi affronta questo limite adottando ABIDES (Agent-Based Interactive Discrete Event Simulator), un simulatore agent-based capace di riprodurre dinamiche realistiche di microstruttura attraverso agenti eterogenei interagenti. Il secondo blocco applica tecniche di Reinforcement Learning (RL) al trading algoritmico: gli agenti vengono addestrati tramite algoritmo PPO con funzioni di ricompensa che modellano diversi gradi di avversione al rischio, analizzando sistematicamente la relazione tra reward, comportamento, redditività e gestione del rischio. La terza parte indaga il problema dell'Inverse Reinforcement Learning (IRL): date le decisioni osservate, è possibile recuperare la funzione di ricompensa sottostante? Il problema viene affrontato tramite GIRL e Σ-GIRL, metodi basati sul gradiente di policy che ricostruiscono i pesi della reward da dimostrazioni esperte. Le funzioni di ricompensa ricostruite vengono quindi utilizzate per riaddestrare gli agenti in un nuovo regime di mercato, nel quale le capacità di generalizzazione vengono valutate confrontandole con la baseline di behavioral cloning. Questo lavoro rappresenta un primo passo verso la modellazione degli obiettivi latenti dei partecipanti al mercato a partire dal comportamento osservato.
File allegati
File Dimensione Formato  
2026_07_Garagiola_Tesi.pdf

accessibile in internet per tutti

Descrizione: Tesi
Dimensione 11.69 MB
Formato Adobe PDF
11.69 MB Adobe PDF Visualizza/Apri
2026_07_Garagiola_Executive_Summary.pdf

accessibile in internet per tutti

Descrizione: Executive Summary
Dimensione 984.51 kB
Formato Adobe PDF
984.51 kB Adobe PDF Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/261235