def compute_prices(sd = dt.datetime(2008,1,1),ed = dt.datetime(2009,12,31),lookback = 21,syms = ['AAPL'], gen_plot = False):
#Read in adjusted closing prices for given symbols, date range
dates = pd.date_range(sd,ed)
prices_all = get_data(syms,dates) #automatically adds SPY
prices = prices_all[syms] #only portfolio symbols
prices_SPY = prices_all['SPY'] #only SPY, for comparision later
return prices, prices_all, prices_SPY
###calculate the stochastic indicator
indicators.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录