def main():
    '''main function for generating portfolio'''
    pp = []
    choices = []
    goodAlphas = [
        'alpha083', 'alpha101', 'alpha024', 'alpha042', 'alpha028', 'alpha025',
        'alpha018', 'alpha010', 'alpha047', 'alpha033', 'alpha009', 'alpha005',
        'alpha051'
    ]
    dist = YFI(0)

    X, Y = Process.ProcessData(dist, 2)

    #alphaIndex = Alphas.SingleAlpha(X, Y, 13)
    for i in range(5):
        result = Prediction.AvgedPredict(dist, X, Y, goodAlphas[:13], 30, 8)
        print(result)

    return result
Ejemplo n.º 2
0
    #Calculate percentage return on particular month
    goodAlphas = [
        'alpha083', 'alpha101', 'alpha024', 'alpha042', 'alpha028', 'alpha025',
        'alpha018', 'alpha010', 'alpha047', 'alpha033', 'alpha009', 'alpha005',
        'alpha051'
    ]
    alphaIndex = goodAlphas
    #target = datetime.datetime(year = 2020, month = 7, day = 1)
    #result = Testing.Designated(target, dist, X, Y, alphaIndex, 10)
    print('Starting to train neural networks......')
    n1 = timi.time()
    resl = {}
    ress = {}

    for i in range(10):
        reslo, ressh = Prediction.AvgedPredict(dist, X, Y, alphaIndex, 10, 10,
                                               '08-01-2020')
        for j in reslo:
            if j in resl:
                resl[j] += 1
            else:
                resl[j] = 1
        for k in ressh:
            if k in ress:
                ress[k] += 1
            else:
                ress[k] = 1
        print(str(i) + ' out of 10 done')

    n2 = int(timi.time() - n1) / 60
    print('Entire Training took' + str(n2) + ' min')
    resl = sorted(resl.items(), key=lambda x: x[1], reverse=True)