ranaroussi / ezibpy

ezIBpy, a Pythonic Client for Interactive Brokers API
Apache License 2.0
324 stars 116 forks source link

Delete Position #28

Closed iranmilad closed 5 years ago

iranmilad commented 5 years ago

hi thank for your library this is too easy use i have a ask i need a function for delete a position (with a example for this work ) so i need a function for get position with id until use for delete this position any time i want

ranaroussi commented 5 years ago

You can't delete a position. If you want to exit a position, you need to submit an order for the same ticker in the opposite direction.

If you're long 100 shares of AAPL, you need to submit an order to sell 100 shares of AAPL (qty=-100).

Hope that helps :)