Skip to content

Commit

Permalink
waditu#30 删除 numba 依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
zengbin93 committed Feb 6, 2021
1 parent 096bd18 commit 1bbea0d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions czsc/utils/ta.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"""
常用技术分析指标:MA, MACD, BOLL
使用 @numba.njit 装饰器,可以大幅提升计算性能,10倍左右
这里为了便于直接通过 github action 打包发布到 pypi,没有使用这个装饰器,需要的可以自己加上
"""
import numpy as np
import numba

@numba.njit()
def SMA(close: np.array, timeperiod=5):
"""简单移动平均
Expand All @@ -27,7 +29,6 @@ def SMA(close: np.array, timeperiod=5):
res.append(seq.mean())
return np.array(res, dtype=np.double)

@numba.njit()
def EMA(close: np.array, timeperiod=5):
"""
https://baike.baidu.com/item/EMA/12646151
Expand All @@ -47,7 +48,6 @@ def EMA(close: np.array, timeperiod=5):
res.append(ema)
return np.array(res, dtype=np.double)

@numba.njit()
def MACD(close: np.array, fastperiod=12, slowperiod=26, signalperiod=9):
"""MACD 异同移动平均线
https://baike.baidu.com/item/MACD%E6%8C%87%E6%A0%87/6271283
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ pyecharts>=1.9.0
tqdm
pandas>=1.1.0
zb>=0.0.14
numpy>=1.16.5
numba>=0.45.1
numpy>=1.16.5
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
url="https://github.com/zengbin93/czsc",
packages=find_packages(exclude=['test', 'images', 'docs']),
include_package_data=True,
install_requires=["pandas", "pyecharts", "mplfinance", "tushare", "matplotlib"],
install_requires=["pandas", "pyecharts", "tushare"],

classifiers=[
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
]
Expand Down

0 comments on commit 1bbea0d

Please sign in to comment.