Ejemplo n.º 1
0
def getTradeCal(exchangeCD, beginDate, endDate, field):
    client = dataApi.Client()
    url = '/api/master/getTradeCal.csv?field=%s&exchangeCD=%s&beginDate=%s&endDate=%s' % (
        field, exchangeCD, beginDate, endDate)
    code, result = client.getData(url)
    if (code == 200):
        return result

    else:
        print code
Ejemplo n.º 2
0
def up_data(start, end, stock_num):
    client = dataApi.Client()
    url = '/api/market/getMktEqud.csv?field=&beginDate=%s&endDate=%s&secID=&ticker=%s&tradeDate=' % (
        start, end, stock_num)
    code, result = client.getData(url)
    if (code == 200):
        return result

    else:
        print code
Ejemplo n.º 3
0
def get_sd_csv(start, end, stock_num, filename):
    client = dataApi.Client()
    url = '/api/market/getMktEqud.csv?field=&beginDate=%s&endDate=%s&secID=&ticker=%s&tradeDate=' % (
        start, end, stock_num)
    code, result = client.getData(url)
    if (code == 200):
        file_object = open(filename, 'w')
        file_object.write(result)
        file_object.close()
        print 'ok'
    else:
        print code
        print result