-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathportfolio.py
69 lines (56 loc) · 1.76 KB
/
portfolio.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import datetime
from xml.sax.handler import property_declaration_handler
import fmp_api as api
class Asset:
def __init__(self, symbol: str, quantity = 0):
# Initialize variables
self.__symbol = symbol
self.quantity = quantity
# __symbol property
@property
def symbol(self):
print("Getting symbol...")
return self.__symbol
# class Receipt:
# def __init__(self, asset: Asset, fee: float = 0.00):
# # Initialize variables
# self.__asset: Asset = asset
# self.__quantity = self.__asset.quantity
# match self.__quantity < 0:
# case True:
# self.__type: str = 'sell'
# case False:
# self.__type: str = 'buy'
# self.__time = datetime.datetime.now()
# self.__price = round(api.get_price(asset.symbol), 2)
# self.__fee: float = round(fee, 2)
# # __fee property
# @property
# def fee(self):
# print("Getting fee...")
# return self.__fee
# # __asset property
# @property
# def asset(self):
# print("Getting asset...")
# return self.__asset
# # __time property
# @property
# def time(self):
# print("Getting time...")
# return self.__time
# # __price property
# @property
# def price(self):
# print("Getting price...")
# return self.__price
# class Portfolio:
# def __init__(self, start_cash: float, start_assets = []):
# # Initialize variables
# self.cash = start_cash
# self.assets = start_assets
# self.receipts = []
# def adjust_cash(self, change: float):
# self.cash += round(change, 2)
# def adjust_asset(self, symbol: str):
# print('hi')