pandas 计算 布林通道 和 唐奇通道
所属分类 quant
浏览量 446
以沪深300指数为例
import pandas as pd
hs300file = "/data/hs300.txt"
hs300df = pd.read_csv(hs300file)
hs300df["up"] = hs300df["high"].rolling(window=20).max()
hs300df["down"] = hs300df["low"].rolling(window=20).min()
hs300df["mid"] = (hs300df["up"] + hs300df["down"]) / 2
hs300df[["up","down","close"]].plot()
hs300df[["up","down","close"]].tail(100).plot()
hs300df["bollstd"] = hs300df["close"].rolling(window=20).std()
hs300df["bollmid"] = hs300df["close"].rolling(window=20).mean()
hs300df["bollhigh"] = hs300df["bollmid"] + 2*hs300df["bollstd"]
hs300df["bolllow"] = hs300df["bollmid"] - 2*hs300df["bollstd"]
hs300df[["bollhigh","bolllow","close"]].plot()
hs300df[["bollhigh","bolllow","close"]].tail(100).plot()
技术分析常用指标
唐奇安通道指标
上一篇
下一篇
Python金融大数据分析(第2版)
常见交易类型
唐奇安通道指标
pandas 股票指数技术分析
pandas dataframe 计算收益率
java量化交易技术资料