I have the same question.
The only way I have found to manage this is to do something like this:
open_orders = get_open_orders(stock)
if context.portfolio.positions[stock].amount is 0 and len(open_orders) is 0:
# open position.
Not sure if this is what you need but maybe it helps a little. If you have some open orders (say stop orders) you need to create more complicated logic and parse open orders probably to find out what they are created for...Also it doesn't cover the case if position is already closed this day.
I know that one other platform I am using does have configuration parameter like 'one entry per stock' which makes it very easy to make sure that your strategy doesn't open lot's of similar positions because of some bug, etc. This would be very useful specially in idea fast prototyping.