Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Please help?

Every time I use the Zero Commission Algorithmic Trading - Robinhood & Quantopian, I get this. (I haven't altered anything)

AttributeError: 'NoneType' object has no attribute 'amount'  
...
USER ALGORITHM:273, in open_new_positions  
(get_order(o_id).amount, security.symbol))
2 responses

Maybe post your algorithm or at least more of the code. Not a lot to go on...

I assume you may be referring to an algorithm in this post https://www.quantopian.com/posts/zero-commission-algorithmic-trading-robinhood-and-quantopian (there are several algorithms). Take a look at the response by Seong Lee Feb 9, 2016 in that post. He addresses the same issue.

Should probably check that 'get_order(o_id)' is actually returning an order. If it's not then it returns nothing or 'NoneType' which doesn't have an attribute '.amount'. That is what the error seems to imply. Maybe just put in the code Seong suggests...

if get_order(o_id):  
                log.info("Ordering %s shares of %s" %  
                     (get_order(o_id).amount, security.symbol))  

Thanks, that helped.