When using the data.current functio, i dont get a value, instead i get equity[aapl] price something then i cant use the whole thing for a logic test.
for example the following is my code
def initialize(context):
# AAPL
context.security_AAPL = [sid(24)]
def handle_data(context, data):
AAPL = data.current(context.security_AAPL, 'price')
print AAPL
print '==========================='
if AAPL == 124.79:
print 'GREAT'
else:
print 'BAD'
in the end it tells me that i have a value error, is there some way i can return just a number when using the data.current function?
This is my first time programming and my english is not good. Sorry.