This forex risk manager is based in the work made by @Deval Keralia in this post. I even copied its Volatility model!

The strategy itself is a simple moving average cross, so is not even a strategy, is just a framework to show the Risk Manager.

The risk manager checks three condition before estimate the entry quantity.

  • The max risk per trade
  • The max exposure per trade
  • The max exposure in all open trades.

And returns two values, the entry quantity and the stop-loss price. The risk manager also implements a trailing order for the stop-loss orders.

I made this testing algorithm for the risk manager class, just in case you want to check it.

If you have some ideas about how to improve it or just some thoughts, I’d love to hear them.


P.S. yeah I know the 2 Sharpe is a clickbait, but maybe without it, you wouldn't read this post at all ;)