Markets and trading · Edition No. 18 · 12 Sep 2026

dcajasn/Riskfolio-Lib

Portfolio optimisation with a large library of risk measures — how capital should be split across strategies.

← Markets and tradingRead the whole edition →

4.5k stars · BSD-3-Clause · 7.3.0 on PyPI (2026-05-31)

Portfolio optimisation with a large library of risk measures — how capital should be split across strategies.

Repo detailsthe review · specs · pros & cons · install

What it is

Riskfolio-Lib is a Python library for portfolio optimisation. It takes the returns of several assets or strategies and produces the mix that best balances return against a risk measure you choose, of which it supports a large number.What it is good for. Anyone with several things to allocate between: strategies, instruments, or time windows. Edition 13 recommended ffn, which answers "which of these candidates is best". This answers the next question, which is "how much of each". ScalpingMate runs one strategy on EURUSD today, so this is a tool for later rather than this weekend. It becomes useful the moment there is a second strategy, or the same strategy on a second pair.

Stars4.5k
LicenceBSD-3-Clause
Latest7.3.0 on PyPI (2026-05-31)checked 7 Sep 2026
Written inC++
Good
  • A very large set of risk measures, not only the textbook one.
  • It draws the results, so the output is a chart rather than a wall of numbers.
  • It works directly with pandas, the standard Python table library, so your existing data fits.
Watch for
  • This is finance mathematics. It gives confident answers to questions you may be asking wrongly.
  • It optimises on past returns. Past returns are not a promise, and on a single strategy it will tell you to put everything in it.
  • Installing it pulls in a solver library, so the first install is larger and slower than most.
Install
cd ~/scalpingmate
source venv/bin/activate
pip install Riskfolio-Lib
Screenshots
dcajasn/Riskfolio-Lib: GitHub preview carddcajasn/Riskfolio-Lib: Screenshot 1dcajasn/Riskfolio-Lib: Screenshot 2

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.