Lapsed Options

Posted By: vinsom

Lapsed Options - 11/17/17 06:47

Hi,
I'm Demo trading options on IB.
I sold some call and put with expiration date 15 Dec 2017, but a few days after entering the trade Zorro is saying that the option was "Lapsed", but is not true, the option is still open in TWS.
Any Idea ?

Thanks
Vincenzo

[Tue 17-11-14 18:15] 951075 +0 -52 0/14 (258.09)

Tuesday 17-11-14 Loss -52.00 ----
!Get Option Chain ITB-OPT--0--SMART--USD
[ITB::SC0772] Lapsed 4 Call 20171215 41.0 400@0.6000: -68.00 at 18:15:01
!Get Option Chain SMH-OPT--0--SMART--USD
[SMH::SC0777] Lapsed 1 Call 20171215 103.0 100@2.3000: -2.00 at 18:15:01
!Get Option Chain VOO-OPT--0--SMART--USD
[VOO::SC0783] Lapsed 1 Call 20171215 240.0 100@1.0000: -37.00 at 18:15:01
!Get Option Chain SPY-OPT--0--SMART--USD
!Get Option Chain XBI-OPT--0--SMART--USD
[XBI::SC0793] Lapsed 2 Call 20171215 83.0 200@1.1100: +102 at 18:15:01
!Get Option Chain XLI-OPT--0--SMART--USD
[XLI::SC0798] Lapsed 2 Call 20171215 72.0 200@0.3400: +22.00 at 18:15:01
!Get Option Chain XLV-OPT--0--SMART--USD
Download ITB.US.. 2903 bars read
Posted By: jcl

Re: Lapsed Options - 11/17/17 09:47

"Lapsed" means that the position was not found at 18:15 in the list of open positions of the TWS. It was then assumed that the position was externally closed.

Did you have an internet interruption or something similar at 18:15?
Posted By: vinsom

Re: Lapsed Options - 11/17/17 11:03

Hi Jcl,
There hasn't been an internet interruption as far as I'm aware of.
But even if there was an interruption, Zorro should say No connection , the plugin should throw an exception, and should not assume that position was closed.

After zorro assumed that positions were closed , it opened again the positions, because the strategy is made to open new positions when there are no positions open. And now there are double position open in TWS.

The good thing is that is a demo account laugh
Posted By: vinsom

Re: Lapsed Options - 11/17/17 11:33


Now I'm just thinking that I'm calling contractCheck , can it be because of this ? But I have only short put/call, no undelying

contractCheck (TRADE*): int
Checks if the option trade is still open. If not, it is assumed that it was expired or exercised. Open positions of the underlying are then also checked and automatically sold at market. This function can be called regularly in a for(open_trades) loop for keeping the positions between broker and strategy in sync. The GET_POSITION command must be supported by the broker API, and no other trades with the same contract type, strike, expiry, and underlying must be opened.
Posted By: jcl

Re: Lapsed Options - 11/17/17 12:13

Yes to both questions: It can normally not be caused by an Internet failure when I think this through, and contractCheck is indeed the function that triggers the "Lapse" message when the option position was not found.

But this does not answer the question why contractCheck did not find the option position on your accout at 18:15, but did find it before. Can you contact Support? They will try to reproduce that problem with your script.
© 2024 lite-C Forums