Commit 8bb09c9a authored by Dr.李's avatar Dr.李

fixed wrong class

parent 43955e6c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 8,
"id": "51382765-24b4-4e5e-a118-077b276e0774",
"metadata": {},
"outputs": [],
......@@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 9,
"id": "47939edc-07d2-4c8e-b061-187806e124ea",
"metadata": {},
"outputs": [],
......@@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 10,
"id": "9a596482-dd98-49dc-b717-c17177f2cd64",
"metadata": {},
"outputs": [],
......@@ -43,7 +43,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 11,
"id": "7e1a0517-e3de-4ea7-ae3c-9c2292c63260",
"metadata": {},
"outputs": [],
......@@ -54,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 12,
"id": "b0d0d48b-708b-447a-922b-500fbfb97600",
"metadata": {},
"outputs": [],
......@@ -64,7 +64,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 13,
"id": "5ccf2dc7-fea9-4d52-b15d-e8ff55fac3dc",
"metadata": {},
"outputs": [],
......@@ -76,7 +76,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 14,
"id": "9d34507e-9efd-479a-8b25-a095de5a552c",
"metadata": {},
"outputs": [
......@@ -148,7 +148,7 @@
"场外货币型基金 542 542 496 542 542 542"
]
},
"execution_count": 7,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
......
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 8,
"id": "76b46662-651d-4bcd-b554-f116051cf297",
"metadata": {},
"outputs": [],
......@@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 9,
"id": "f5d4b805-d5a3-4b4c-8429-7044e9bef831",
"metadata": {},
"outputs": [],
......@@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 10,
"id": "72d3f785-aee7-44d9-a393-3abbdb4d60a4",
"metadata": {},
"outputs": [],
......@@ -43,7 +43,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 11,
"id": "f5f5cc7d-c2d4-4c7f-b8a9-dd133407f9c6",
"metadata": {},
"outputs": [],
......@@ -54,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 12,
"id": "52607b95-9d62-4f68-8256-984827dd0bea",
"metadata": {},
"outputs": [],
......@@ -64,7 +64,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 13,
"id": "60fe66ee-a8d3-4a33-8c5a-555f68d9758c",
"metadata": {},
"outputs": [],
......@@ -76,7 +76,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 14,
"id": "1bb62bc7-2515-415a-8eec-087d2d1787b6",
"metadata": {},
"outputs": [
......@@ -177,7 +177,7 @@
"量化对冲基金 10 17 17 17 "
]
},
"execution_count": 7,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
......
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 10,
"id": "b81e5b9e-b8f5-4198-b98c-2e26f025875c",
"metadata": {},
"outputs": [],
......@@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 11,
"id": "8bf4331c-c1db-47b4-b72d-10d5ccb72657",
"metadata": {},
"outputs": [],
......@@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 12,
"id": "d228ec88-a55b-4451-8a69-1a0e490b9161",
"metadata": {},
"outputs": [],
......@@ -43,7 +43,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 13,
"id": "7763ee34-dbba-4297-b2d8-16fc98be8a3b",
"metadata": {},
"outputs": [],
......@@ -54,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 14,
"id": "e12d8f3b-0570-40db-9ec3-d6804b78c686",
"metadata": {},
"outputs": [],
......@@ -64,7 +64,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 15,
"id": "b3f87023-d068-4014-975c-22db615c3273",
"metadata": {},
"outputs": [
......@@ -75,7 +75,7 @@
" 'QDII房地产信托基金', '灵活配置型基金(股票上限95%)(A类)'], dtype=object)"
]
},
"execution_count": 7,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
......@@ -86,7 +86,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 16,
"id": "0efd51eb-a03c-440b-b083-a36df52f9185",
"metadata": {},
"outputs": [],
......@@ -100,7 +100,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 17,
"id": "850b9707-8849-48b5-9b39-9111ab78ccc1",
"metadata": {},
"outputs": [
......@@ -235,7 +235,7 @@
"QDII股票型基金 53 40 53 53 53 "
]
},
"execution_count": 9,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
......
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 9,
"id": "de082674-0285-4894-905a-52da1ab1727d",
"metadata": {},
"outputs": [],
......@@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 10,
"id": "11d2dbfe-b1c7-41b1-8df3-b6f40b096f83",
"metadata": {},
"outputs": [],
......@@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 11,
"id": "004a8f9f-4011-48c6-a5dd-327cce42de51",
"metadata": {},
"outputs": [],
......@@ -43,7 +43,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 12,
"id": "acf00858-6782-4ecb-8a87-9045810ce589",
"metadata": {},
"outputs": [],
......@@ -54,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 13,
"id": "08bfc149-90e5-405d-a1f2-6ec750c26f9e",
"metadata": {},
"outputs": [],
......@@ -65,7 +65,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 14,
"id": "493e2114-8eaa-4c5c-bec4-2e297eaf3c99",
"metadata": {},
"outputs": [
......@@ -115,7 +115,7 @@
"Index: []"
]
},
"execution_count": 21,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
......@@ -126,7 +126,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 15,
"id": "fc897e0e-46f1-48a2-be9a-6381086c94bf",
"metadata": {},
"outputs": [
......@@ -304,7 +304,7 @@
"3902 稳健成长型 "
]
},
"execution_count": 8,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
......
......@@ -92,11 +92,18 @@ def fd_typeclass(security_ids, trade_dt=None):
sec_id_strs = ",".join(["'" + s + "'" for s in security_ids])
query = f"""
select SECURITYID, L1CODE, L1NAME, L2CODE, L2NAME, L3CODE, L3NAME from TQ_FD_TYPECLASS
select TQ_FD_BASICINFO.SECODE as SECURITYID,
TQ_FD_TYPECLASS.L1CODE,
TQ_FD_TYPECLASS.L1NAME,
TQ_FD_TYPECLASS.L2CODE,
TQ_FD_TYPECLASS.L2NAME,
TQ_FD_TYPECLASS.L3CODE,
TQ_FD_TYPECLASS.L3NAME from TQ_FD_TYPECLASS join TQ_FD_BASICINFO on TQ_FD_BASICINFO.SECURITYID = TQ_FD_TYPECLASS.SECURITYID
WHERE
ISVALID = 1 AND
SECURITYID in ({sec_id_strs}) AND
(ENDDATE >= '{trade_dt}' or ENDDATE = '19000101')
TQ_FD_TYPECLASS.ISVALID = 1 AND
TQ_FD_BASICINFO.ISVALID = 1 AND
TQ_FD_BASICINFO.SECODE in ({sec_id_strs}) AND
(TQ_FD_TYPECLASS.ENDDATE >= '{trade_dt}' or TQ_FD_TYPECLASS.ENDDATE = '19000101')
"""
return read_sql(query)
......@@ -163,9 +170,9 @@ def fd_qtfdnav(security_ids, trade_dt):
sec_id_strs = ",".join(["'" + s + "'" for s in security_ids])
query = f"""
SELECT SECODE as SECURITYID, UNITNAV, ACCUNITNAV from TQ_QT_FDNAV
SELECT SECODE as SECURITYID, UNITNAV, UNITACCNAV, REPAIRUNITNAV, NAVGRTD from TQ_FD_DERIVEDN
WHERE
NAVDATE = '{trade_dt}' AND
ENDDATE = '{trade_dt}' AND
ISVALID = 1 AND
SECODE in ({sec_id_strs})
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment