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” ?