Recently, I have been working on a project called longleaf for algorithmic trading of US stocks with OCaml. The project has reached a point where it may be interesting to others, so I thought I would share it here and write a simple README, although there could be a lot more documentation. I would be curious to hear if anyone has any ideas for this! If you try to use it or have any feedback or questions, feel free to leave a post here, make a github issue, or make a github discussion.
In a nutshell, the idea is that strategies are functors that are instantiated with a “backend” for backtesting, live, or paper trading. That way, whether you are testing your strategy or running it live, it is exactly the same strategy other than how the execution of orders is handled. In order to use it, you will need to set up some accounts and there are likely bugs. Of course, if you use this program with real money and something bad happens, it is entirely your responsibility!