Beispiel #1
0
 def __init__(self, name):
     code = int(name[-1])
     assert code >= 1 and code <= 8, "Invalid stock: %s" % name
     EquitySecurity.__init__(self, name)
     self.retriever = retriever.get_bovespa_retriever()
     self.category = MainCategories.Stocks
     self.subcategory = StocksCategories.NationalIndex
Beispiel #2
0
 def __init__(self, name):
     code = int(name[-1])
     assert code >= 3 and code <= 8, "Invalid stock: %s" % name
     EquitySecurity.__init__(self, name)
     self.retriever = retriever.get_bovespa_retriever()
     self.category = MainCategories.Stocks
     self.subcategory = StocksCategories.NationalIndex
Beispiel #3
0
 def __init__(self, name, subcat):
     assert name.endswith("11")
     assert StocksCategories[subcat] is not None, "Subcategory: %s" % subcat
     FundShare.__init__(self, name)
     self.retriever = retriever.get_bovespa_retriever()
     self.category = MainCategories.Stocks
     self.subcategory = StocksCategories[subcat]
Beispiel #4
0
 def __init__(self, name, subcat):
     assert name.endswith("11")
     assert StocksCategories[subcat] is not None, "Subcategory: %s" % subcat
     FundShare.__init__(self, name)
     self.retriever = retriever.get_bovespa_retriever()
     self.category = MainCategories.Stocks
     self.subcategory = StocksCategories[subcat]
Beispiel #5
0
 def __init__(self, name, stock):
     code = int(name[-1])
     assert code == 1 or code == 2
     self.stock = stock
     EquitySecurity.__init__(self, name)
     self.retriever = retriever.get_bovespa_retriever()
     self.category = MainCategories.Stocks
     self.subcategory = StocksCategories.NationalIndex
Beispiel #6
0
 def __init__(self, name, stock):
     code = int(name[-1])
     assert code == 1 or code == 2
     self.stock = stock
     EquitySecurity.__init__(self, name)
     self.retriever = retriever.get_bovespa_retriever()
     self.category = MainCategories.Stocks
     self.subcategory = StocksCategories.NationalIndex
Beispiel #7
0
 def test_bovespa(self):
     print
     dr = get_bovespa_retriever()
     self.assertIsNotNone(dr)
     self.assertAlmostEqual(
         dr.get_value("ITUB3", "2014-01-02"),
         29.43
     )
     self.assertAlmostEqual(
         dr.get_value("PETR3", "2014-01-02"),
         15.82
     )
     self.assertAlmostEqual(
         dr.get_value("BBDC3", "2015-01-01"),
         34.32
     )
Beispiel #8
0
 def __init__(self, name):
     assert name.endswith("11")
     EquitySecurity.__init__(self, name)
     self.retriever = retriever.get_bovespa_retriever()
     self.category = MainCategories.Stocks
     self.subcategory = StocksCategories.NationalIndex
Beispiel #9
0
 def __init__(self, name):
     assert name.endswith("11") or name.endswith("11B")
     FundShare.__init__(self, name)
     self.retriever = retriever.get_bovespa_retriever()
     self.category = MainCategories.RealEstate
Beispiel #10
0
 def __init__(self, name):
     assert name.endswith("11")
     EquitySecurity.__init__(self, name)
     self.retriever = retriever.get_bovespa_retriever()
     self.category = MainCategories.Stocks
     self.subcategory = StocksCategories.NationalIndex
Beispiel #11
0
 def __init__(self, name):
     assert name.endswith("11") or name.endswith("11B")
     FundShare.__init__(self, name)
     self.retriever = retriever.get_bovespa_retriever()
     self.category = MainCategories.RealEstate
     self.subcategory = RealEstateCategories.Brick