Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Need Help with Open Orders

Hi All,

I'm pretty new to Quantopian as well as python and coding in general. I'm looking for some help with some of the get_open_orders commands. Does anyone know a way to write a statement saying "if there are no open orders, then enter this order(ex. buy AAPL, 100 shares), otherwise do nothing. I'm not sure if it would be something like "if get_open_orders == False" but I haven't seemed to find the correct way to state this in python. I am sure it's something rather simple that I am just not getting as an amateur coder.
Any help would be much appreciated.

Thanks!

2 responses
if not get_open_orders():  
    order(symbol('AAPL'), 100)  

It worked perfectly! Thanks Michael!