Im not sure if it posted correctly. Here is the code I am working on:
monthly_prices = ((data.history(context.assets, 'price', 14*21, '1d')).resample('1M', how='last', closed='left', label='left'))
monthly_prices2 = (((data.history(context.assets, 'price', 50*21, '1d')).resample('1M', how='last', closed='left', label='right'))[1:36])
#print monthly_prices2
rsis = {}
rsis2 = {}
open_orders = get_open_orders()
for stock in context.assets:
rsi = talib.RSI(monthly_prices[stock], timeperiod=14)[-1]
rsis[stock] = rsi
rsi2 = talib.RSI(monthly_prices2[stock], timeperiod=14)[1:36][-1]
rsis2[stock] = rsi2
print rsi2
if (context.portfolio.cash > 100.0) & (stock not in open_orders and data.can_trade(stock)) & (rsi > rsi2.max()):
order_target(stock, 1)