コード例 #1
0
ファイル: buySignal.py プロジェクト: chengtalent/StockAnalyse
def updateBuySignalStocks():
    stockList = dao.getCandidateFromDB()

    todayStr = utility.getLastDay()

    count = 0
    for stock in stockList:
        data = dao.get_break_through_status(stock)
        if len(data) != 0:
            continue

        data = dao.get_hist_data(stock)
        if data[len(data)-1][1] != todayStr:
            continue

        array = data[-20:]
        max = 0
        for i in range(0, len(array)-1):
            if array[i][4] > max:
                max = array[i][4]

        if len(array) > 18 and array[len(array)-1][4] > max:
            analyseData = dao.get_stock_analyse_data(stock)
            analyseData = analyseData[-1:]

            if len(analyseData) == 0 or analyseData[0][2] > analyseData[0][3]:
                dao.add_new_break_through(stock, array[len(array) - 1][4], todayStr)
                count += 1

    print 'add ' + str(count) + ' new break stocks'
コード例 #2
0
def calAnalyseDataInit():
    stockList = dao.getCandidateFromDB()

    for stock in stockList:
        data = dao.get_hist_data(stock)
        if len(data) <= 300:
            continue

        calAnalyseDataForSeveralDays(data)
コード例 #3
0
def calAnalyseDataForUpdate():
    stockList = dao.getCandidateFromDB()

    for stock in stockList:
        data = dao.get_hist_data(stock)
        if len(data) <= 300:
            continue

        analysData = dao.get_stock_analyse_data(stock)
        if len(analysData) == 0:
            calAnalyseDataForSeveralDays(data)
        else:
            calAnalyseDataForOneDay(data, analysData)

        print str(stock),

    print 'update analyse data'