For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

How to handle option expirations ?

  • Would custom observer be a viable solution ?

  • administrators

    The answer to the question probably needs some extra background information.

    What is exactly meant with "handling of options expirations"?

  • Multiple data feeds first one underlying and rest of the data streams are options at different strikes and expirations.

    Back testing runs from day T to day T+100. I buy a call option which expires T+25 on T+5 and never close the position.

    My question is how does the position close it self and adjust account value correctly ? I guess it would be different for cash settled options (easier maybe).

  • administrators

    Positions on assets don't close themselves. A buy action, for example, needs a corresponding sell action to close the position.

    One possibility to consider would be that data feeds could carry a tag to indicate an expiration datetime, which the broker could honour to close the position.

    But there is something puzzling in your message:

    • Back testing runs from day T to day T+100
    • On T+5 an option which expires on T+25 is bought
    • What happens during T+26 and T+100? Because the option is already gone at T+25?

    • Do you have something like continuous option prices?

  • New positions can be opened closed between T+26 and T+100, but nothing related to expiring option. It doesn't get rolled or anything. I have continuous option prices(until expiration of course).

    Figuring/carrying expiration date is not my main concern. I am wondering how to sell at the correct value when it expires, last price of the option doesn't necessarily indicate correct settlement value.

    At each next do I check if it is past expiration for all open positions and then close accordingly ? How will the trade go thru if there is no data (because it's past expiration) ?

Log in to reply