StockInsider: A股交易指標可視化包
一、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()
#只繪製K線 si.plot(verbose=False)
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()
# 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()
# 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()
往期文章
看在這麼多數據面子上,給我點好看可好❤