A maximum drawdown (MDD) is the maximum observed loss from a peak to a trough of a portfolio before a new peak is attained. Maximum drawdown is an indicator of downside risk over a specified time period. (Source: Investopedia)
1
from empyrial import empyrial, Engine
2
β
3
portfolio = Engine(
4
start_date ="2018-01-01",
5
portfolio=["BABA","PDD","KO","AMD","^IXIC"],
6
risk_manager ={"Max Drawdown":-0.2}#Stop the investment when the drawdown becomes superior to -20%