How to know open positions in python api