23

StockInsider: A股交易指标可视化包

 4 years ago
source link: http://mp.weixin.qq.com/s?__biz=MzI1MTE2ODg4MA%3D%3D&%3Bmid=2650072653&%3Bidx=1&%3Bsn=5ddbe9bdbd127952b0b21764e91729a5
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

一、StockInsider

StockInsider可以获取中国上市股票价格相关的信息,计算交易指标,可视化指标。

1.1 安装

命令行输入

!pip3 install StockInsider

1.2 工具简介

StockInsider需要两个参数

  • code,必要参数;上市公司股票代码。股票代码前需要加上'sh'或'sz',例如 sz002156 或者 sh603019

  • ktype,可选参数;k线类型默认是D,表示是日线。也可以选择 W(周线)、M(月线);所有的指标都是以日线为基准的。

stockinsider文档上用的sz002156,不代表个人投资建议;投资有风险,入市需谨慎

from insider import StockInsider

si = StockInsider('sz002156')
si
<insider.stock_insider.StockInsider at 0x1034bfad0>

二、StockInsider类的方法

  • 股票价格图

  • 股票交易指标图

2.1 股票价格图

StockInsider默认使用plotly绘制的图表。

si.plot(head = 90, start_date, end_date, verbose=True)
  • head: 默认90,将会绘出最近90个交易日的曲线。

  • start_date: 起始时间(字符串)

  • end_date: 终止时间(字符串)

  • verbose: 默认为True;True表示全部绘制(k线、ma5、ma10、ma20);True只绘制k线。

#默认得到最近90日的K线图
si.plot()

QrY7viV.png!web

#只绘制K线
si.plot(verbose=False)

AFZV7fR.png!web

2.2 股票交易指标

(目前,这个工具支持画出以下的指标):

  • MA (Moving Average, 移动平均线): si.plot_ma()
  • MD (Moving Deviation, 移动标准差曲线): si.plot_md()
  • EMA (Exponential Moving Average, 指数移动平均线): si.plot_ema()
  • MACD (Moving Average Convergence/Divergence,指数平滑移动均线): si.plot_macd()
  • KDJ (随机指标): si.plot_kdj()
  • RSI (Relative Strength Index,相对强弱指标): si.plot_rsi()
  • VRSI (Volumn Relative Strength Index,量相对强弱指标): si.plot_vrsi()
  • Volumn change(量变指标): si.plot_volumn()
  • VMA (Volumn Moving Average,量移动平均线): si.plot_vma()
  • VSTD(成交量标准差): si.plot_vstd()
  • VMACD (Volumn Moving Average Convergence/Divergence,量指数平滑异同平均线): si.plot_vmacd()
  • ENV(轨道线): si.plot_env()
  • VOSC (Volumn Oscillator,量震荡指标): si.plot_vosc()
  • MI (Momentum Indicator,动力指标): si.plot_mi()
  • MIKE(麦克指标): si.plot_mike()
  • ADTM(动态买卖气指标): si.plot_adtm()
  • OBV (On Balance Volumn,能量潮曲线): si.plot_obv()
  • RC (Price rate of Change,变化率指标): si.plot_rc()
  • BOLL (BOLL line,布林线): si.plot_boll()
  • BBIBOLL (BBI BOLL line,多空布林线): si.plot_bbiboll()
# MA (Moving Average)
# 移动平均线
si.plot_ma()

QZ3quuZ.png!web

# MD (Moving Deviation)
# 移动标准差曲线
si.plot_md()

j2y6r2i.png!web

#EMA (Exponential Moving Average, 指数移动平均线)
si.plot_ema()

qMVreuB.png!web

#MACD (Moving Average Convergence/Divergence)
#指数平滑移动均线
si.plot_macd()

rQRFruY.png!web

#KDJ (随机指标)
si.plot_kdj()

uQrQNjR.png!web

#RSI (Relative Strength Index)
#相对强弱指标
si.plot_rsi()

yMZRnmJ.png!web

#VRSI (Volumn Relative Strength Index)
#量相对强弱指标
si.plot_vrsi()

muQjUrV.png!web

#Volumn change(量变指标)
si.plot_volumn()

Qf2QVfM.png!web

#VMA (Volumn Moving Average)
#量移动平均线
si.plot_vma()

Azq6BnR.png!web

#VSTD(成交量标准差)
si.plot_vstd()

2U7NZfv.png!web

#VMACD (Volumn Moving Average Convergence/Divergence) 
# 量指数平滑异同平均线
si.plot_vmacd()

mqEzy2N.png!web

# VOSC (Volumn Oscillator)
#量震荡指标
si.plot_vosc()

RrAR3iq.png!web

# MI (Momentum Indicator)
# 动力指标
si.plot_mi()

2QrA3m3.png!web

# MIKE(麦克指标)
si.plot_mike()

u2mQF3Y.png!web

# ADTM(动态买卖气指标)
si.plot_adtm()

VzMNnar.png!web

# OBV (On Balance Volumn)
# 能量潮曲线
si.plot_obv()

iiUVZ3V.png!web

# RC (Price rate of Change)
# 变化率指标
si.plot_rc()

U7nUbyY.png!web

# BOLL (BOLL line)
# 布林线
si.plot_boll()

mQre2un.png!web

# BBIBOLL (BBI BOLL line)
# 多空布林线
si.plot_bbiboll()

EnqYJrU.png!web

往期文章

中文文本分析相关资源汇总

Pandas时间序列数据操作

cnsenti中文情绪情感分析库

70G上市公司定期报告数据集

如何计算出文本数据的相似矩阵?

两行代码读取pdf、docx文件

三行代码计算文本相似性

5个小问题带你理解列表推导式

文本数据清洗之正则表达式

Python网络爬虫与文本数据分析

综述:文本分析在市场营销研究中的应用

LabelStudio多媒体数据标注工具[5星推荐]

如何批量下载上海证券交易所上市公司年报

Loughran&McDonald金融文本情感分析库

Numpy和Pandas性能改善的方法和技巧

如何使用Python快速构建领域内情感词典

Python数据分析相关学习资源汇总帖

漂亮~pandas可以无缝衔接Bokeh

YelpDaset: 酒店管理类数据集10+G

看在这么多数据面子上,给我点好看可好❤


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK