示例#1
0
def showStockChart(stockcode):

    stockcode = stock.normalizeStockCode(stockcode)
    kdata = stock.getStockDayDataQianFuQuan(stockcode)
    if (not kdata):
        utils.output('股票数据不存在', 'red')
        return False

    if (stockcode[:3] != 'sh0'):
        weightdata = stock.getStockWeightData(stockcode)
        if (not weightdata):
            utils.output('复权数据不存在', 'red')
            return False
        #print(weightdata)

    #set data
    globals.mainwin.chart.kdata = kdata
    globals.mainwin.chart.stockcode = stockcode
    globals.mainwin.scrollbar.setMinimum(0)
    ktotalcount = len(kdata)
    globals.mainwin.scrollbar.setMaximum(ktotalcount)
    globals.mainwin.scrollbar.setValue(ktotalcount)
    globals.mainwin.scrollbar.setSingleStep(1)
    if (stockcode[:3] != 'sh0'):
        globals.mainwin.chart.weightdata = weightdata

    #draw
    globals.viewportclear = False
    utils.update()
示例#2
0
def showStockChart(stockcode):
    
    stockcode = stock.normalizeStockCode(stockcode)
    kdata = stock.getStockDayDataQianFuQuan(stockcode)
    if(not kdata):
        utils.output('股票数据不存在', 'red')
        return False

    if(stockcode[:3] != 'sh0'):
        weightdata = stock.getStockWeightData(stockcode)
        if(not weightdata):
            utils.output('复权数据不存在', 'red')
            return False
        #print(weightdata)

    #set data
    globals.mainwin.chart.kdata = kdata
    globals.mainwin.chart.stockcode = stockcode
    globals.mainwin.scrollbar.setMinimum(0)
    ktotalcount = len(kdata)
    globals.mainwin.scrollbar.setMaximum(ktotalcount)
    globals.mainwin.scrollbar.setValue(ktotalcount)
    globals.mainwin.scrollbar.setSingleStep(1)
    if(stockcode[:3] != 'sh0'):
        globals.mainwin.chart.weightdata = weightdata

    #draw
    globals.viewportclear = False
    utils.update()
示例#3
0
def run(subcmd, params):

    stockcode = 'sh600603'
    wd = stock.getStockWeightData(stockcode)
    print(wd)