I seem to be having a little trouble getting the ROE data to work. It keeps logging a context error, definitely a simple fix but I'm stuck on this. Any help would be greatly appreciated. Thank you.
import numpy
def initialize(context):
context.limit = 3
def before_trading_start(context):
context.fundamentals = get_fundamentals(
query(
fundamentals.valuation_ratios.peg_ratio,
fundamentals.operation_ratios.roe,
)
.filter(fundamentals.valuation_ratios.peg_ratio < 1)
.order_by(
fundamentals.valuation.market_cap.desc()
fundamentals.operation_ratios.roe.desc()
)
.limit(context.limit)
)
context.hello = context.fundamentals
update_universe(context.hello.columns.values)
print "___________________________________\n"
def handle_data(context, data):
for stock in range(context.limit):
print context.hello.columns[stock]