IBKR - Options assignment

Hi all, I am about to write a bit of code to close a position on the underlying, in case I write an option and get assigned.

Let's say I write an option and at expiration time is ITM, then I get assigned a position on the underlying.

Is there any configuration I could change on my account to let IBKR close that position immediately?

My initial idea was to write a watcher on the account, and at the expiration time check if there is anything on the underlying and close it. Am I overcomplicating it?
 
Hi all, I am about to write a bit of code to close a position on the underlying, in case I write an option and get assigned.

Let's say I write an option and at expiration time is ITM, then I get assigned a position on the underlying.

Is there any configuration I could change on my account to let IBKR close that position immediately?

My initial idea was to write a watcher on the account, and at the expiration time check if there is anything on the underlying and close it. Am I overcomplicating it?

I think this can get hairy.
But I don’t know your book.
 
Hi all, I am about to write a bit of code to close a position on the underlying, in case I write an option and get assigned.

Let's say I write an option and at expiration time is ITM, then I get assigned a position on the underlying.

Is there any configuration I could change on my account to let IBKR close that position immediately?

My initial idea was to write a watcher on the account, and at the expiration time check if there is anything on the underlying and close it. Am I overcomplicating it?
Make sure you know the difference between American & European Options assignments before you model anything. -kPwn
 
Hi all, I am about to write a bit of code to close a position on the underlying, in case I write an option and get assigned.

Let's say I write an option and at expiration time is ITM, then I get assigned a position on the underlying.

Is there any configuration I could change on my account to let IBKR close that position immediately?

My initial idea was to write a watcher on the account, and at the expiration time check if there is anything on the underlying and close it. Am I overcomplicating it?

You can use conditional orders on IKBR (trade station) based on the price of the underlying. So set it to close if the price tags the short leg. That won't protect you after close or pre market, and assignment can happen early as well. I would just trade cash settled options like indexes.
 
You can use conditional orders on IKBR (trade station) based on the price of the underlying. So set it to close if the price tags the short leg. That won't protect you after close or pre market, and assignment can happen early as well. I would just trade cash settled options like indexes.

That is a good answer sir. I haven't used conditional orders for anything, but they make sense for this.

Thank you.
 
The only solution is to check your portfolio every [time interval] for a position in stock/ future xyz and if position is > x --> create a market order. Other then that you have no trigger you can work with as the event "getting assigned" is not something the API supports, besides a time delayed notification you could read. But due to the delay you would be liquidated before you can react.
 
Back
Top