Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Converting to new Data (Old formula depreciated) help please!

Old Formula

def ordering_logic(context, data):
if 'Close' in data['ABC'] and 'Close' in data['XYZ']:
ABC = data['ABC']['Close']
XYZ = data['XYZ']['Close']


New Formula??  
def ordering_logic(context, data):  
    if 'Close' in data['ABC'] and 'Close' in data['XYZ']:     << How do I change this line, I keep getting errors...  
        vix = data.current('ABC','Close')  
        vxst = data.current('XYZ','Close')  

Many THanks!!!

Also how about this part too please?
Do you know how to convert this to the new formula?

if 'price' in data['sid']:

4 responses

if data.current(assets='ABC', fields='close" ) etc etc

Hi Peter thank you v much

Do you know how to convert this to the new formula?

if 'price' in data['sid']:

I tried this, believe its right

if data.current('sid','price'):

Hey Jerrick,
If you are trying to update algorithms from Quantopian 1 to Quantopian 2, you might be interested in these posts where I do exactly that for Sentdex's tutorial. I provide code and a good breakdown of what exactly has changed.

Here's the first post.

Here's the second.

Here's the third.