# Code examples of solving Stochastic Optimal Control problems

I'm currently reading a book demonstrating how Stochastic Optimal Control can solve common optimization problems encountered within quantitative finance. I haven't covered much continuous mathematics at this level (most of my degree was discrete) I would probably find it easier understanding the practical solution via a code implementation.

Are there any online resources solving Stochastic Optimal Control problems via code?

• Stochastic Optimal Control is a very difficult field, requiring much study to master (and I don't think I ever quite mastered it, I did take a few courses). Some books are more theoretical and some are more engineering oriented (usually stressing the discrete time formulation of the problems, or discrete time approximations, and the intuition). But looking at code I think could be a mistake, too much low level detail, unless you already have an overview. Commented Oct 21, 2017 at 13:23
• @AlexC thanks for your reply. The book is Algorithmic and High Frequency Trading and I really want to master it's content because it relates to a lot of the work I do, such as smart order execution, market-making etc. I'm just struggling following the notation. I am looking at formulae thinking "so how exactly would I implement that?". Eventually i'd like to understand enough so that I could know when to use/combine/modify techniques for any given requirement. Commented Oct 21, 2017 at 13:38
• There has been quite an extensive research on the topic during the recent years - you can see for example papers authored by Marco Avellaneda, Olivier Gueant, Sasha Stoikov, Albert Lehalle. They try to solve the problem of optimal market-making exactly via Stochastic Optimal Control, i.e. HJB equations. For example, a seminal paper by Stoikov and Avellaneda, High-frequency trading in a limit order book, gives explicit formulas for a market-maker in order to maximize his expected gains. This paper is, in my opinion, quite understandable, and you might gain some additional insight. Commented Oct 21, 2017 at 19:45
• @user997112 I don't know if you are still active but I would ask anyway. Can you please mention the name of the book you're referring to? Commented Jan 9, 2021 at 2:17