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
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
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]
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
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 )
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
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
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