Beispiel #1
0
class CIndicatorKursVor12M(CIndicator):
    def __init__(self):
        CIndicator.__init__(self)
        self.__FinanzenNet = CFinanzenNet()
        self.__StockDict = dict()
        self._Name = str(self.__class__)

    def getPoints(self, stock):
        '''
        check if this stock has already been processed
        '''

        if stock in self.__StockDict:
            return self.__StockDict[stock]

        self.__FinanzenNet.parseFinanzenNet(stock)

        if (self.__FinanzenNet.AktienkursVor12Monaten > 0):

            ratio = self.__FinanzenNet.AktienkursHeute / self.__FinanzenNet.AktienkursVor12Monaten

            if ratio > 1.05:
                result = 1
            elif ratio < 0.95:
                result = -1
            else:
                result = 0

        else:
            result = 0

        self.__StockDict[stock] = result

        return result
Beispiel #2
0
class CImporterSMI(CImporter):
    def __init__(self):
        self.__FN = CFinanzenNet()
        self.__Onvista = COnvista()
        self.__StockList = list()

        self.__AnzahlAktienInIndex = 20
        self._strIndexFinanzenNet = "SMI"
        self.__strBoerseFinanzenNet = "FSE"

    def getListOfStocks(self):

        self.__StockList = self.__FN.getEinzelwerteListe(
            self._strIndexFinanzenNet)

        self.validateListeLaenge(self.__StockList, self.__AnzahlAktienInIndex,
                                 self._strIndexFinanzenNet)

        for i in self.__StockList:
            i.strBoerseFinanzenNet = self.__strBoerseFinanzenNet
            i.strIndexFinanzenNet = self._strIndexFinanzenNet
            i.FinanzenNetId = self.__FN.getFinanzenNetId(i)
            i.OnvistaId = self.__Onvista.getOnvistaId(i)
            mkap = self.__Onvista.getMarktkapitalisierungInEuro(i)
            if mkap > 5 * pow(10, 9):
                i.isLargeCap = True
            else:
                i.isLargeCap = False

        return self.__StockList
Beispiel #3
0
class CIndicatorKBV(CIndicator):
    def __init__(self):
        CIndicator.__init__(self)
        self.__FinanzenNet = CFinanzenNet()
        self.__StockDict = dict()
        self._Name = str(self.__class__)

    def getPoints(self, stock):

        """
        check if this stock has already been processed
        """

        if stock in self.__StockDict:
            kbv = self.__StockDict[stock]
        else:
            self.__FinanzenNet.parseFinanzenNet(stock)
            kbv = self.__FinanzenNet.KBV
            self.__StockDict[stock] = kbv

        result = 0

        if kbv == "NA":
            result = 0
            print "Warnung: " + self._Name + ": " + stock.Name + ": Wert nicht verfuegbar"
        elif kbv < 0.6:
            result = 2
        elif kbv < 0.9 and kbv >= 0.6:
            result = 1
        elif kbv < 1.3 and kbv >= 0.9:
            result = 0
        else:
            result = -1

        return result
Beispiel #4
0
class CImporterEuroStoxx50(CImporter):

    def __init__(self):
        self.__FN = CFinanzenNet()
        self.__Onvista= COnvista()
        self.__StockList = list()
        
        self.__AnzahlAktienInIndex = 50
        self._strIndexFinanzenNet = "Euro_Stoxx_50"
        self.__strBoerseFinanzenNet = "FSE"
        
    def getListOfStocks(self):
        
        self.__StockList = self.__FN.getEinzelwerteListe(self._strIndexFinanzenNet)
        
        self.validateListeLaenge(self.__StockList, self.__AnzahlAktienInIndex, self._strIndexFinanzenNet)
        
        for i in self.__StockList:
            i.strBoerseFinanzenNet =  self.__strBoerseFinanzenNet
            i.strIndexFinanzenNet = self._strIndexFinanzenNet
            i.FinanzenNetId = self.__FN.getFinanzenNetId(i)
            i.OnvistaId = self.__Onvista.getOnvistaId(i)
            mkap = self.__Onvista.getMarktkapitalisierungInEuro(i)
            if mkap > 5*pow(10,9):
                i.isLargeCap = True
            else:
                i.isLargeCap= False
        
                
        return self.__StockList
Beispiel #5
0
class CIndicatorKursVor6M(CIndicator):
    def __init__(self):
        CIndicator.__init__(self)
        self.__FinanzenNet = CFinanzenNet()
        self.__StockDict = dict()
        self._Name = str(self.__class__)

    def getPoints(self, stock):

        """
        check if this stock has already been processed
        """

        if stock in self.__StockDict:
            return self.__StockDict[stock]

        self.__FinanzenNet.parseFinanzenNet(stock)

        if self.__FinanzenNet.AktienkursVor6Monaten > 0:
            ratio = self.__FinanzenNet.AktienkursHeute / self.__FinanzenNet.AktienkursVor6Monaten

            if ratio > 1.05:
                result = 1
            elif ratio < 0.95:
                result = -1
            else:
                result = 0

        else:
            result = 0

        self.__StockDict[stock] = result

        return result
Beispiel #6
0
    def __init__(self):
        self.__FN = CFinanzenNet()
        self.__Onvista = COnvista()
        self.__StockList = list()

        self.__AnzahlAktienInIndex = 20
        self._strIndexFinanzenNet = "SMI"
        self.__strBoerseFinanzenNet = "FSE"
Beispiel #7
0
    def printData(self, StockList, PointList, IndicatorList, Importer):

        finanzenNet = CFinanzenNet()

        print "Aktie \t ISIN \t Punkte \t KBV"

        c = 0
        for i in StockList:
            print i.Name + " \t " + str(i.ISIN) + " \t " + str(
                PointList[c]) + " \t " + str(finanzenNet.getKBV(i))
            c = c + 1
class CIndicator3MonatsReversal(CIndicator):
    def __init__(self):
        CIndicator.__init__(self)

        self.__FinanzenNet = CFinanzenNet()
        self.__StockDict = dict()
        self._Name = str(self.__class__)

    def getPoints(self, stock):

        if stock.isLargeCap == False:
            return 0

        if stock in self.__StockDict:
            return self.__StockDict[stock]

        self.__FinanzenNet.parseFinanzenNet(stock)

        aktieAenderung = [0, 0, 0]
        indexAenderung = [0, 0, 0]

        kleiner = 0
        groesser = 0

        if (self.__FinanzenNet.AktieList[3] > 0):
            for i in [0, 1, 2]:
                aktieAenderung[i] = self.__FinanzenNet.AktieList[
                    i] / self.__FinanzenNet.AktieList[i + 1]
                indexAenderung[i] = self.__FinanzenNet.IndexList[
                    i] / self.__FinanzenNet.IndexList[i + 1]

                if aktieAenderung[i] < indexAenderung[i]:
                    kleiner = kleiner + 1
                elif aktieAenderung[i] > indexAenderung[i]:
                    groesser = groesser + 1

            if kleiner == len(aktieAenderung):
                result = 1
            elif groesser == len(aktieAenderung):
                result = -1
            else:
                result = 0
        else:
            result = 0

        self.__StockDict[stock] = result

        return result
class CIndicator3MonatsReversal(CIndicator):

    def __init__(self):
        CIndicator.__init__(self)
        
        self.__FinanzenNet = CFinanzenNet()
        self.__StockDict = dict()
        self._Name = str(self.__class__)
        
    def getPoints(self, stock):    
        
        if stock.isLargeCap == False:
            return 0
        
        if stock in self.__StockDict:
            return self.__StockDict[stock]
            
        self.__FinanzenNet.parseFinanzenNet(stock)
        
        aktieAenderung = [0, 0, 0]
        indexAenderung = [0,0,0]
        
        kleiner = 0
        groesser = 0
        
        if(self.__FinanzenNet.AktieList[3] > 0):
            for i in [0,1,2]:
                aktieAenderung[i] = self.__FinanzenNet.AktieList[i] / self.__FinanzenNet.AktieList[i+1]
                indexAenderung[i] = self.__FinanzenNet.IndexList[i] / self.__FinanzenNet.IndexList[i+1]
                
                if aktieAenderung[i] < indexAenderung[i]:
                    kleiner = kleiner + 1
                elif aktieAenderung[i] > indexAenderung[i]:
                    groesser = groesser + 1
                
            if kleiner == len(aktieAenderung):
                result = 1
            elif groesser == len(aktieAenderung):
                result = -1
            else:
                result = 0
        else:
            result = 0
                  
        self.__StockDict[stock] = result      
        
        return result   
Beispiel #10
0
 def __init__(self):
     self.__FN = CFinanzenNet()
     self.__Onvista= COnvista()
     self.__StockList = list()
     
     self.__AnzahlAktienInIndex = 50
     self._strIndexFinanzenNet = "Euro_Stoxx_50"
     self.__strBoerseFinanzenNet = "FSE"
Beispiel #11
0
 def printData(self, StockList, PointList, IndicatorList, Importer):
     
     finanzenNet = CFinanzenNet()
     
     print "Aktie \t ISIN \t Punkte \t KBV"
     
     c = 0
     for i in StockList:
         print i.Name + " \t " +  str(i.ISIN) + " \t " + str(PointList[c]) + " \t " + str(finanzenNet.getKBV(i))  
         c =c + 1
Beispiel #12
0
class CIndicatorKBV(CIndicator):

    def __init__(self):
        CIndicator.__init__(self)
        self.__FinanzenNet = CFinanzenNet()
        self.__StockDict = dict()
        self._Name = str(self.__class__)
        
    def getPoints(self, stock):    
        
        '''
        check if this stock has already been processed
        '''
        
        if stock in self.__StockDict:
            kbv= self.__StockDict[stock]
        else:    
            self.__FinanzenNet.parseFinanzenNet(stock)
            kbv = self.__FinanzenNet.KBV
            self.__StockDict[stock] = kbv
        
        result = 0
        
        if kbv == "NA":
            result = 0
            print "Warnung: " + self._Name + ": " + stock.Name + ": Wert nicht verfuegbar"
        elif kbv < 0.6:
            result = 2
        elif (kbv < 0.9 and kbv >= 0.6):
            result = 1
        elif (kbv < 1.3 and kbv >= 0.9):
            result = 0
        else:
            result = -1
        
        
        return result
Beispiel #13
0
 def __init__(self):
     CIndicator.__init__(self)
     self.__FinanzenNet = CFinanzenNet()
     self.__StockDict = dict()
     self._Name = str(self.__class__)
Beispiel #14
0
 def __init__(self):
     CIndicator.__init__(self)
     self.__FinanzenNet = CFinanzenNet()
     self.__StockDict = dict()
     self._Name = str(self.__class__)