quant1x 0.2.1__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {quant1x-0.2.1 → quant1x-0.3.0}/PKG-INFO +2 -2
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/__init__.py +1 -2
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/base/formula.py +1 -1
- quant1x-0.3.0/quant1x/data/futu-basicinfo.py +27 -0
- quant1x-0.3.0/quant1x/data/quotes.py +637 -0
- quant1x-0.3.0/quant1x/findpeaks/__init__.py +13 -0
- quant1x-0.3.0/quant1x/findpeaks/filters/__init__.py +0 -0
- quant1x-0.3.0/quant1x/findpeaks/filters/frost.py +168 -0
- quant1x-0.3.0/quant1x/findpeaks/filters/kuan.py +139 -0
- quant1x-0.3.0/quant1x/findpeaks/filters/lee.py +147 -0
- quant1x-0.3.0/quant1x/findpeaks/filters/lee_enhanced.py +163 -0
- quant1x-0.3.0/quant1x/findpeaks/filters/mean.py +122 -0
- quant1x-0.3.0/quant1x/findpeaks/filters/median.py +103 -0
- quant1x-0.3.0/quant1x/findpeaks/findpeaks.py +1253 -0
- quant1x-0.3.0/quant1x/findpeaks/interpolate.py +194 -0
- quant1x-0.3.0/quant1x/findpeaks/stats.py +593 -0
- quant1x-0.3.0/quant1x/findpeaks/union_find.py +73 -0
- quant1x-0.3.0/quant1x/indicator/__init__.py +4 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x.egg-info/PKG-INFO +2 -2
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x.egg-info/SOURCES.txt +13 -4
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x.egg-info/requires.txt +1 -1
- {quant1x-0.2.1 → quant1x-0.3.0}/setup.py +6 -4
- quant1x-0.2.1/quant1x/data/quotes.py +0 -204
- quant1x-0.2.1/quant1x/indicator/__init__.py +0 -8
- quant1x-0.2.1/quant1x/indicator/cdtd.py +0 -78
- quant1x-0.2.1/quant1x/indicator/f89k.py +0 -150
- quant1x-0.2.1/quant1x/indicator/hjk.py +0 -70
- quant1x-0.2.1/quant1x/indicator/p2fb.py +0 -97
- {quant1x-0.2.1 → quant1x-0.3.0}/LICENSE +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/README.rst +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/base/__init__.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/base/basic.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/base/formula_plus.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/base/series.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/data/__init__.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/formula/__init__.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/indicator/ma1x.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/strategy/__init__.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/strategy/bad_base.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/strategy/linear_regression.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/util/__init__.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x/util/font.py +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x.egg-info/dependency_links.txt +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x.egg-info/entry_points.txt +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x.egg-info/not-zip-safe +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/quant1x.egg-info/top_level.txt +0 -0
- {quant1x-0.2.1 → quant1x-0.3.0}/setup.cfg +0 -0
|
@@ -150,7 +150,7 @@ def rolling_apply(S, N, func: Callable[..., Any], raw: bool = False):
|
|
|
150
150
|
N = np.repeat(N, s_len)
|
|
151
151
|
for i in range(s_len):
|
|
152
152
|
if (not np.isnan(N[i])) and N[i] <= i + 1:
|
|
153
|
-
window = N[i]
|
|
153
|
+
window = int(N[i])
|
|
154
154
|
T = S[i + 1 - window:i + 1]
|
|
155
155
|
ret[i] = func(T, window)
|
|
156
156
|
return ret
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/python
|
|
2
|
+
# -*- coding: UTF-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
证券基本信息
|
|
5
|
+
"""
|
|
6
|
+
from futu import *
|
|
7
|
+
|
|
8
|
+
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
|
|
9
|
+
print('******************************************')
|
|
10
|
+
ret, data = quote_ctx.get_stock_basicinfo(Market.SH, SecurityType.STOCK)
|
|
11
|
+
if ret == RET_OK:
|
|
12
|
+
data.to_csv('sh.csv', index=False)
|
|
13
|
+
else:
|
|
14
|
+
print('error:', data)
|
|
15
|
+
print('******************************************')
|
|
16
|
+
ret, data = quote_ctx.get_stock_basicinfo(Market.SZ, SecurityType.STOCK)
|
|
17
|
+
if ret == RET_OK:
|
|
18
|
+
data.to_csv('sz.csv', index=False)
|
|
19
|
+
else:
|
|
20
|
+
print('error:', data)
|
|
21
|
+
ret, data = quote_ctx.get_stock_basicinfo(Market.HK, SecurityType.STOCK)
|
|
22
|
+
if ret == RET_OK:
|
|
23
|
+
data.to_csv('hk.csv', index=False)
|
|
24
|
+
else:
|
|
25
|
+
print('error:', data)
|
|
26
|
+
|
|
27
|
+
quote_ctx.close() # 结束后记得关闭当条连接,防止连接条数用尽
|