Skip to content

Commit

Permalink
Merge pull request #1387 from yutiansut/master
Browse files Browse the repository at this point in the history
#update for quantaxis 1.7.4
  • Loading branch information
yutiansut authored Jan 10, 2020
2 parents 2bae56e + f25f20d commit d398d0f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions QUANTAXIS/QAData/financial_mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,5 @@
'313未知313':'unknown313',
'314未知314':'unknown314',
'315未知315':'unknown315',
'316未知316':'unknown316',
}
19 changes: 19 additions & 0 deletions QUANTAXIS/QAFetch/QAKQ.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import requests
import json
import pandas as pd

def QA_fetch_get_future_domain():
"""
获取快期的主连代码
return [list]
"""
res = pd.DataFrame(json.loads(requests.get("https://openmd.shinnytech.com/t/md/symbols/latest.json").text)).T
return res.loc[res.ins_name.str.contains('主连')].underlying_symbol.apply(lambda x: x.split('.')[1]).tolist()





if __name__ == "__main__":
print(QA_fetch_get_future_domain())
5 changes: 4 additions & 1 deletion QUANTAXIS/QAFetch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from QUANTAXIS.QAFetch import QAfinancial
from QUANTAXIS.QAFetch.base import get_stock_market
from QUANTAXIS.QAFetch import QAQAWEB as QAWEB

from QUANTAXIS.QAFetch import QAKQ as QAKQ

def use(package):
if package in ['wind']:
Expand Down Expand Up @@ -318,6 +318,9 @@ def QA_fetch_get_future_transaction_realtime(package, code):
return 'Unsupport packages'


def QA_fetch_get_future_domain():
return QAKQ.QA_fetch_get_future_domain()

def QA_fetch_get_future_realtime(package, code):
Engine = use(package)
return Engine.QA_fetch_get_future_realtime(code)
Expand Down
3 changes: 2 additions & 1 deletion QUANTAXIS/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
2017/4/8
"""

__version__ = '1.7.3'
__version__ = '1.7.4'
__author__ = 'yutiansut'

import argparse
Expand Down Expand Up @@ -112,6 +112,7 @@
QA_fetch_get_bond_list,
QA_fetch_get_bond_realtime,
QA_fetch_get_future_realtime,
QA_fetch_get_future_domain,
QA_fetch_get_future_transaction,
QA_fetch_get_future_transaction_realtime,
QA_fetch_get_globalfuture_day,
Expand Down

0 comments on commit d398d0f

Please sign in to comment.