Take Profit

A take-profit order (T/P) is a type of limit order that specifies the exact price at which to close out an open position for a profit. If the price of the security does not reach the limit price, the take-profit order does not get filled. (Source: Investopedia)
from empyrial import empyrial, Engine
portfolio = Engine(
start_date = "2018-01-01",
portfolio= ["BABA", "PDD", "KO", "AMD","^IXIC"],
optimizer = "EF",
rebalance = "1y", #rebalance every year
risk_manager = {"Take Profit" : 0.25} #Stop the investment when the profit becomes superior to 25%
)
empyrial(portfolio)