Skip to content

Commit

Permalink
0.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmysoa committed Dec 24, 2016
1 parent 690db33 commit 3424473
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions tushare/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
__version__ = '0.6.3'
__version__ = '0.6.5'
__author__ = 'Jimmy Liu'

"""
for trading data
"""
Expand Down
4 changes: 2 additions & 2 deletions tushare/stock/cons.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
INDEX_LIST = {'sh': 'sh000001', 'sz': 'sz399001', 'hs300': 'sz399300',
'sz50': 'sh000016', 'zxb': 'sz399005', 'cyb': 'sz399006', 'zx300': 'sz399008', 'zh500':'sh000905'}
P_TYPE = {'http': 'http://', 'ftp': 'ftp://'}
PAGE_NUM = [38, 60, 80, 100]
PAGE_NUM = [40, 60, 80, 100]
FORMAT = lambda x: '%.2f' % x
FORMAT4 = lambda x: '%.4f' % x
DOMAINS = {'sina': 'sina.com.cn', 'sinahq': 'sinajs.cn',
Expand Down Expand Up @@ -71,7 +71,7 @@
TICK_PRICE_URL = '%smarket.%s/%s?date=%s&symbol=%s'
TODAY_TICKS_PAGE_URL = '%s%s/quotes_service/api/%s/CN_Transactions.getAllPageTime?date=%s&symbol=%s'
TODAY_TICKS_URL = '%s%s/quotes_service/view/%s?symbol=%s&date=%s&page=%s'
KLINE_TT_URL = '%sweb.ifzq.%s/appstock/app/%skline/get?_var=kline_day%s&param=%s,%s,%s,%s,380,%s&r=0.%s'
KLINE_TT_URL = '%sweb.ifzq.%s/appstock/app/%skline/get?_var=kline_day%s&param=%s,%s,%s,%s,640,%s&r=0.%s'
KLINE_TT_MIN_URL = '%sifzq.%s/appstock/app/kline/mkline?param=%s,m%s,,640&_var=m%s_today&r=0.%s'
DAY_PRICE_URL = '%sapi.finance.%s/%s/?code=%s&type=last'
LIVE_DATA_URL = '%shq.%s/rn=%s&list=%s'
Expand Down
5 changes: 3 additions & 2 deletions tushare/stock/trading.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,11 +650,12 @@ def get_k_data(code=None, start='', end='',
urls = []
for year in years:
startdate = str(year) + '-01-01'
enddate = str(year+1) + '-06-30'
enddate = str(year+1) + '-12-30'
url = ct.KLINE_TT_URL%(ct.P_TYPE['http'], ct.DOMAINS['tt'],
kline, fq+str(year), symbol,
ct.TT_K_TYPE[ktype.upper()], startdate, enddate,
fq, _random(17))
print(url)
urls.append(url)
dataflag = '%s%s'%(fq, ct.TT_K_TYPE[ktype.upper()])
elif ktype in ct.K_MIN_LABELS:
Expand Down Expand Up @@ -748,4 +749,4 @@ def _code_to_symbol(code):
return ''
else:
return 'sh%s'%code if code[:1] in ['5', '6', '9'] else 'sz%s'%code

3 changes: 0 additions & 3 deletions tushare/trader/trader.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
from tushare.trader import vars as vs
from tushare.trader import utils
from tushare.util import upass as up
from tushare.util.upass import get_broker, set_broker
from astropy.units import acount


class TraderAPI(object):
"""
Expand Down
1 change: 1 addition & 0 deletions tushare/util/dateu.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,4 @@ def _random(n=13):
def get_q_date(year=None, quarter=None):
dt = {'1': '-03-31', '2': '-06-30', '3': '-09-30', '4': '-12-31'}
return '%s%s'%(str(year), dt[str(quarter)])

0 comments on commit 3424473

Please sign in to comment.