
一 选股1.1 基本面1.2 估值1.2.1 常用指标说明二 择时2.1 技术分析2.2 常用工具说明三 量化交易平台3.1聚宽量化平台介绍四 股价常用指标五 股价均线5.1卷积5.2 简单移动均线5.3指数移动均线import matplotlib import numpy as np import matplotlib.pyplot as plt matplotlib.use(TkAgg) class TestNumpyMA(): def __init__(self): self.file ./commont.csv self.end_price np.loadtxt(fnameself.file, delimiter,, usecols(2), unpackTrue, skiprows1) # print(self.end_price) def testSMA(self): n 5 # 移动窗口 weights np.ones(n) / n # 生成权重 print(weights) sma np.convolve(weights, self.end_price)[n-1: -n1] #生成卷积 print(sma) plt.plot(sma, linewidth5) plt.show() def testEXP(self): x np.arange(5) y np.arange(10) print(x) print(y) print(np.exp(x)) print(np.exp(y)) print(np.linspace(-1, 0, 5)) def testEMA(self): n 5 # 移动窗口 weights np.ones(n) / n # 生成权重 print(weights) sma np.convolve(weights, self.end_price)[n - 1: -n 1] # 生成卷积 t np.arange(n-1, len(self.end_price)) plt.plot(t, self.end_price[n-1: ], lw1.0) plt.plot(t, sma, lw2.0) plt.show() if __name__ __main__: tnma TestNumpyMA() # tnma.testSMA() # tnma.testEXP() tnma.testEMA()