Question about get_position()

If there is no position, get_position() returns an error.
Is this the intended result ?
p=api.get_position(‘TSLA’)
p.qty

5
p=api.get_position(‘AAPL’)
p.qty
APIError: position does not exist

I have the same problem. I can’t figure it out.

Try this :slight_smile:

p=api.get_position(‘AMD’).qty

print(‘total number of share:’ + str§);