indicators.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:Machine_Learning_Trading_System 作者: historycapital 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号