-
Notifications
You must be signed in to change notification settings - Fork 1
/
multiples.py
71 lines (54 loc) · 1.75 KB
/
multiples.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
69
70
71
import publicCompany
class multiples:
def __init__(self, ticker):
self.originalCompany = publicCompany.publicCompany(ticker)
self.compList = []
self.PElist = []
self.PEGlist = []
self.PriceBookList = []
def add(self,ticker):
company = publicCompany.publicCompany(ticker)
self.compList.append(company)
#PE multiples
newList = [];
newList.append(ticker)
newList.append(float(company.PERatio))
self.PElist.append(newList)
self.PElist.sort(key=lambda x: x[1])
#PEG multiples
PEG = [];
PEG.append(ticker)
PEG.append(float(company.PEGRatio))
self.PEGlist.append(PEG)
self.PEGlist.sort(key=lambda x: x[1])
#PriceBookValue
PriceBook = []
PriceBook.append(ticker)
PriceBook.append(float(company.PriceBook))
self.PriceBookList.append(PriceBook)
self.PriceBookList.sort(key=lambda x: x[1])
def toString(self):
self.originalCompany.toString()
for i in range(len(self.compList)):
self.compList[i].toString()
def printPElist(self):
print self.PElist
def printPEGlist(self):
print self.PEGlist
def printPriceBook(self):
print self.PriceBookList
def printEquityMultiples(self):
print "Equity Multiples"
print "PE List"
self.printPElist()
print "PEG List"
self.printPEGlist()
print "PriceBook List"
self.printPriceBook()
test = multiples("AAPL")
test.add("MSFT")
test.add("JNJ")
test.add("WFC")
test.add("JPM")
test.add("PG")
test.printEquityMultiples()