Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, Nymphodora), 1,012 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Lapsed Options #469459
11/17/17 06:47
11/17/17 06:47
Joined: Nov 2016
Posts: 103
NSW
V
vinsom Offline OP
Member
vinsom  Offline OP
Member
V

Joined: Nov 2016
Posts: 103
NSW
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

Re: Lapsed Options [Re: vinsom] #469466
11/17/17 09:47
11/17/17 09:47
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
"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?

Re: Lapsed Options [Re: jcl] #469474
11/17/17 11:03
11/17/17 11:03
Joined: Nov 2016
Posts: 103
NSW
V
vinsom Offline OP
Member
vinsom  Offline OP
Member
V

Joined: Nov 2016
Posts: 103
NSW
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

Re: Lapsed Options [Re: vinsom] #469475
11/17/17 11:33
11/17/17 11:33
Joined: Nov 2016
Posts: 103
NSW
V
vinsom Offline OP
Member
vinsom  Offline OP
Member
V

Joined: Nov 2016
Posts: 103
NSW

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.

Re: Lapsed Options [Re: vinsom] #469476
11/17/17 12:13
11/17/17 12:13
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
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.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1