1
1
# -*- coding: utf-8 -*-
2
- # Thanks for the works from QUANTAXIS
3
-
4
2
import datetime
5
-
6
- import numpy as np
7
3
import pandas as pd
8
4
import json
9
5
from pytdx .exhq import TdxExHq_API
10
6
from pytdx .hq import TdxHq_API
11
7
from retrying import retry
12
8
from abquant .utils .logger import system_log as slog
13
- from abquant .utils .logger import user_log as ulog
14
9
from abquant .utils .cache import Cache
15
10
from abquant .utils .parallelism import Parallelism
16
11
from abquant .utils .tdx import *
@@ -66,7 +61,6 @@ def select_best_ip():
66
61
slog .debug ("Selecting the Best Server IP of TDX." )
67
62
68
63
# 删除exclude ip
69
- null = None
70
64
exclude_ip = {"ip" : "1.1.1.1" , "port" : 7709 }
71
65
default_ip = {
72
66
"stock" : {"ip" : None , "port" : None },
@@ -87,7 +81,7 @@ def select_best_ip():
87
81
stock_ip_list = Setting .make_stock_ip_list ()
88
82
future_ip_list = Setting .make_future_ip_list ()
89
83
90
- if ipdefault ["stock" ]["ip" ] == None :
84
+ if ipdefault ["stock" ]["ip" ] is None :
91
85
best_stock_ip = get_ip_list_by_ping (stock_ip_list )
92
86
else :
93
87
if ping (
@@ -98,7 +92,7 @@ def select_best_ip():
98
92
else :
99
93
slog .error ("DEFAULT STOCK IP is BAD, RETESTING" )
100
94
best_stock_ip = get_ip_list_by_ping (stock_ip_list )
101
- if ipdefault ["future" ]["ip" ] == None :
95
+ if ipdefault ["future" ]["ip" ] is None :
102
96
best_future_ip = get_ip_list_by_ping (future_ip_list , _type = "future" )
103
97
else :
104
98
if ping (
@@ -281,8 +275,6 @@ def get_stock_list(type_="stock", ip=None, port=None):
281
275
return data .assign (code = data ["code" ].apply (lambda x : str (x ))).assign (
282
276
name = data ["name" ].apply (lambda x : str (x )[0 :6 ])
283
277
)
284
- # .assign(szm=data['name'].apply(lambda x: ''.join([y[0] for y in lazy_pinyin(x)])))\
285
- # .assign(quanpin=data['name'].apply(lambda x: ''.join(lazy_pinyin(x))))
286
278
287
279
288
280
@retry (stop_max_attempt_number = 3 , wait_random_min = 50 , wait_random_max = 100 )
@@ -412,11 +404,6 @@ def get_stock_day(
412
404
else :
413
405
slog .warn ("CURRENTLY NOT SUPPORT REALTIME FUQUAN" )
414
406
return None
415
- # xdxr = get_stock_xdxr(code)
416
- # if if_fq in ['01','qfq']:
417
- # return QA_data_make_qfq(data,xdxr)
418
- # elif if_fq in ['02','hfq']:
419
- # return QA_data_make_hfq(data,xdxr)
420
407
except Exception as e :
421
408
slog .error (e )
422
409
0 commit comments