Skip to content

Commit 248747a

Browse files
committed
增加20种常用的技术指标算法,可通过get_k_hist()数据计算MA,MD,EMA,MACD,KDJ,RSI,BOLL,WNR,DMI,BIAS,ASI,VR,ARBR,DPO,TRIX,BBI,MTM,OBV指标。
1 parent 94337e9 commit 248747a

File tree

3 files changed

+1028
-1
lines changed

3 files changed

+1028
-1
lines changed

test/indictor_test.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# -*- coding:utf-8 -*-
2+
'''
3+
Created on 2018/05/26
4+
@author: Jackie Liao
5+
'''
6+
import unittest
7+
import tushare.stock.indictor as idx
8+
import tushare as ts
9+
10+
11+
class Test(unittest.TestCase):
12+
13+
def test_plot_all(self):
14+
data = ts.get_k_data("601398", start="2018-01-01", end="2018-05-27")
15+
16+
data = data.sort_values(by=["date"], ascending=True)
17+
18+
idx.plot_all(data, is_show=True, output=None)
19+
20+
21+
if __name__ == "__main__":
22+
# import sys;sys.argv = ['', 'Test.testName']
23+
unittest.main()

tushare/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,9 @@
131131
from tushare.coins.market import (coins_tick, coins_bar,
132132
coins_snapshot, coins_trade)
133133

134-
from tushare.util.conns import (get_apis, close_apis)
134+
from tushare.util.conns import (get_apis, close_apis)
135+
136+
"""
137+
for stock indictors
138+
"""
139+
from tushare.stock import (indictor)

0 commit comments

Comments
 (0)