portfolio_toolkit.position.closed.closed_position module

class portfolio_toolkit.position.closed.closed_position.ClosedPosition(ticker: str, buy_price: float, quantity: float, buy_date: str, sell_price: float, sell_date: str)[source]

Bases: Position

buy_date: str
sell_price: float
sell_date: str
value: float
profit: float
return_percentage: float
classmethod to_list(positions: List[ClosedPosition]) List[source]

Convert a list of Position objects to a pandas DataFrame.

classmethod to_dataframe(positions: List[ClosedPosition]) DataFrame[source]

Convert a list of Position objects to a pandas DataFrame.

__init__(ticker: str, buy_price: float, quantity: float, buy_date: str, sell_price: float, sell_date: str) None
ticker: str
buy_price: float
quantity: float
cost: float