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
0 registered members (), 863 guests, and 4 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
Page 2 of 3 1 2 3
Re: Bug with option expirations [Re: Zheka] #484776
12/08/21 22:45
12/08/21 22:45
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
Setting ExpiryTime=2200 solves the problem (though the log message is now incorrect
Quote
[2457: Wed 21-05-19 19:40:00] 6361 -58.00 637/505 (410.77)
[SPY::SC45525] Expired OTM 1 Call 20210519 414.0 100@410.78: +324 Unl 410.78 at 19:40:00 Thu <--should be Wed
[SPY::SP45526] Expired ITM 1 Put 20210519 418.0 100@410.78: -413 Unl 410.78 at 19:40:00 Thu

[2458: Thu 21-05-20 19:40:00] 6329 0 637/505 (415.18)

I don't think using market close regardless of actual expiry time/abandoning ExpiryTime is reasonable: CME FX options have moved in Sept 2019 to morning expirations(10am)...there might be some other cases.

But:
- the default ExpiryTime should indeed be set after the market close - to cover the majority of cases
- it should be in BarZone time, not UTC.

Re: Bug with option expirations [Re: Zheka] #484781
12/09/21 10:30
12/09/21 10:30
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
The problem would be solved by setting the ExpiryTime default at 23:00. The options expire then at the Friday close price. The log is then not incorrect because we're in the next bar, but admittedly confusing.

We'll find a solution for the upcoming release, probably with a 23:00 UTC detault for ExpiryTime and a different log message.

For options that expire in the morning or at a different time, ExpiryTime must be set to that time, and the timestamps in the historical options data must then also reflect that time. There is no perfect solution except using higher resolution data.


Re: Bug with option expirations [Re: Zheka] #484782
12/09/21 10:50
12/09/21 10:50
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
Can ExpiryTime be made to respect BarZone? There are no options in the world expiring in UTC...

..And Z13 system will have to be adjusted/stats restated..

Last edited by Zheka; 12/09/21 10:52.
Re: Bug with option expirations [Re: Zheka] #484784
12/09/21 11:10
12/09/21 11:10
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
It can not, because that would break existing scripts that already use ExpiryTime.

Re: Bug with option expirations [Re: Petra] #485102
01/23/22 08:10
01/23/22 08:10
Joined: Oct 2021
Posts: 10
Z
ztests Offline
Newbie
ztests  Offline
Newbie
Z

Joined: Oct 2021
Posts: 10
Originally Posted by Petra
I can already tell you what the reason probably is, ExpiryTime is 12 UTC by default and at that time, the most recent underlying is the price from the previous bar and not from market close because that would be in the future.

That makes sense for intrabar selling but not for expiration. So I think it should be changed, zheka is right, for expiration the market close price should be used regardless of ExpiryTime.



is there a way to set the option expiration time manually in order to experiment with this feature?

I am comparing now Zorro versions 2.40 and 2.44 and would like to emulate the old option expiration handling procedure in the new 2.44 version.

Thank you in advance!

Re: Bug with option expirations [Re: Zheka] #485103
01/23/22 08:32
01/23/22 08:32
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
Its a variable. You can set it.

Re: Bug with option expirations [Re: Petra] #485119
01/24/22 18:32
01/24/22 18:32
Joined: Oct 2021
Posts: 10
Z
ztests Offline
Newbie
ztests  Offline
Newbie
Z

Joined: Oct 2021
Posts: 10
Originally Posted by Petra
Its a variable. You can set it.



Petra – thank you!

Indeed when set to ExpiryTime=1200, I see the old option trading behavior around the expiration time.

However, the option strategy performance I am testing is still different between the different Zorro versions.

Using the same Zorro script, same data, same R installation I have also noticed that Zorro 2.40 used to select longer expiry options (than specified 6 weeks) more often and Zorro 2.44 tends to be more precise – is it possible that some bugs in option selection procedure were fixed or some other changes were implemented?

Re: Bug with option expirations [Re: Zheka] #485124
01/25/22 16:53
01/25/22 16:53
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Yes, the contract chain is now sorted by expiration and strike. So it finds the contract faster. Still, it should normally be the same contract, since the best match is not affected by sorting order. You could post details about what contract you wanted and what contract you got in both versions.

Re: Bug with option expirations [Re: jcl] #485128
01/26/22 08:24
01/26/22 08:24
Joined: Oct 2021
Posts: 10
Z
ztests Offline
Newbie
ztests  Offline
Newbie
Z

Joined: Oct 2021
Posts: 10
Originally Posted by jcl
Yes, the contract chain is now sorted by expiration and strike. So it finds the contract faster. Still, it should normally be the same contract, since the best match is not affected by sorting order. You could post details about what contract you wanted and what contract you got in both versions.



Hi JCL,

thank very much for the comments – that explains a bit the results.

At this stage I am trying to understand the differences between the Zorro versions by simply “observing” the major differences between the trades/options selected.

It is tricky to meaningfully compare the option trades (generated by different Zorro versions) since those are path dependent. Here is one example at the beginning of the testing period - in both cases the maturity is specified to be 6 weeks / 42 days for call options on SPY:

Zorro 2.40
Open - Close - ExitType - Days
2015-07-01 19:20 - 2015-08-21 19:20 - Expired - 51
2015-08-21 19:20 - 2015-10-16 19:20 - Expired - 56

Zorro 2.44
Open - Close - ExitType - Days
2015-07-01 19:20 - 2015-08-21 19:20 - Expired - 51
2015-08-21 19:20 - 2015-10-02 19:20 - Expired - 42

As I wrote – in tendency Zorro 2.44 selects options with maturities “closer” to 6 weeks. I use this function to select options:

contract (int Type, int Days, var Strike): CONTRACT*

and the documentation says that the function “selects the option or future contract that has an expiration closest to the given minimum life time in Days and strike closest to the given Strike value”. So in both cases the function results are correct.

As in the example above - it makes sense “sometimes” to select 3rd Friday options because of liquidity/costs/etc, but it would be good to know or even control those trade-offs somehow.

I was wondering – is there a code or documentation how the distance is measured (in the function above) to find an option with the “closest to the given minimum life time in Days and strike closest to the given Strike value” ?

Re: Bug with option expirations [Re: Zheka] #485131
01/26/22 17:06
01/26/22 17:06
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
When selected? With which parameters? Strikes? Which ExpiryTime?

Page 2 of 3 1 2 3

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