I get the error: "Requested history at frequency 'm' cannot be created with data at frequency 'daily'." when I try to run this. Any ideas?
import talib as ta
import numpy as np
import pandas as pd
import zipline
from zipline import TradingAlgorithm
from zipline.api import symbol, history, add_history
data = get_pricing(
['SPY'],
start_date='2015-07-06',
end_date = '2015-07-07',
frequency='minute')
def initialize(context):
add_history(200, '1m', 'price')
context.i = 0
def handle_data(context, data):
context.i += 1
if context.i < 200:
return
history('200','1m','price')
algo_obj = TradingAlgorithm(
initialize=initialize,
handle_data=handle_data
)
algo_obj._analyze = analyze
perf_manual = algo_obj.run(data.transpose(2,1,0))