Code

Open-source implementations accompanying my research papers.

YadhHafsi/Optimal-Execution-with-Reinforcement-Learning-in-a-Multi-Agent-Market-SimulatorPython
ABIDES-Gym execution environment, DQN training, baselines (TWAP, passive, random), out-of-sample evaluation across five market scenarios, figures and trained policies.
price trend
Illustrative (stylised random walk, not simulator output): buying a fixed order over the window, TWAP spreads it evenly; a schedule that tilts within a corridor buys faster after price rises and slower after falls. In this toy model it saves about 2 price units per share on average when a trend persists (up or down) and is break-even when there is none.
YadhHafsi/Policy-Gradient-Learning-for-Distributionally-Robust-OptimizationPython
Reference implementation of Algorithm 1 of the paper. Reproduces all figures across four benchmarks: coin toss, inventory control, self-exciting bandits, and robust linear-quadratic control under Wasserstein ambiguity.
Wasserstein radius ε = 0.35
Interactive: grow the ambiguity ball and watch the adversary shift the model — the robust policy optimizes against the worst case P*.
murex/deep-mkv-genPython
Official implementation of the Deep McKean–Vlasov generative model: learning generative dynamics for financial time series with soft law constraints via forward–backward SDEs.
time t = 0.40
Interactive: particles generated by the McKean–Vlasov dynamics — with law constraints on, the marginals are pinned to the prescribed law along the whole path, not just at the terminal time.
TomasEspana/qrm_optimal_executionJupyter Notebook
Implementation of the reinforcement-learning approach to optimal execution in a queue-reactive limit order book model, including the market simulator and training notebooks.
Interactive: a queue-reactive limit order book — arrival intensities depend on queue sizes; empty a best queue (or hit "sell") and the mid price moves.
YadhHafsi/Optimal-Execution-under-Incomplete-InformationJupyter Notebook
Numerical solvers and simulation experiments supporting the paper: optimal execution with partial information on liquidity, via stochastic filtering and control.
Interactive: a self-exciting order flow whose baseline intensity switches with a hidden liquidity regime — the execution problem is solved under this partial information.