0
我无法弄清楚为什么我只能在控制台中获取分钟数据而不是日常数据,不管我在代码中声明的内容是否写入frequency = '1d'
或frequency = '1m'
,结果总是在几分钟内仅显示分钟价格的Quantopian数据历史记录
def initialize(context):
# AAPL, MSFT, and SPY
context.securities = [sid(24), sid(5061), sid(8554)]
def handle_data(context, data):
prices = data.history(context.securities, "price", bar_count = 10, frequency = "1d")
pct_change = (prices.ix[-1] - prices.ix[0])/prices.ix[0]
log.info(pct_change)