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)
1
from empyrial import empyrial, Engine
2
​
3
portfolio = Engine(
4
start_date = "2018-01-01",
5
portfolio= ["BABA", "PDD", "KO", "AMD","^IXIC"],
6
optimizer = "EF",
7
rebalance = "1y", #rebalance every year
8
risk_manager = {"Take Profit" : 0.25} #Stop the investment when the profit becomes superior to 25%
9
)
10
​
11
empyrial(portfolio)
Copied!
Last modified 2mo ago
Copy link