Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 522 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
contractNext() not working? #476191
02/03/19 18:00
02/03/19 18:00
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline OP
Junior Member
mhdus  Offline OP
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
I'm having no luck using the contractNext() function for an options chain. The function does not seem to return any valid contracts... is this a bug or me misunderstanding its usage? I'attaching my simple test script running against SPY options data.

Output looks like this:

strike: 200.0
no next strike found
no prev strike found
V 2.016 on Sun 19-02-03 18:52:20 (Zorro S Subscription)
Test: CheckContractNext SPY 2016..2018
[1: Tue 16-01-05 15:40] (201.38)
strike: 201.0
no next strike found
no prev strike found
[2: Wed 16-01-06 15:40] (198.83)
strike: 199.0
no next strike found
no prev strike found
[3: Thu 16-01-07 15:40] (194.04)
strike: 195.5
no next strike found
no prev strike found
...

Any ideas?

Attached Files
CheckContractNext.c (36 downloads)
Re: contractNext() not working? [Re: mhdus] #476200
02/04/19 08:31
02/04/19 08:31
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I believe the parameters are wrong. contractNext needs a valid expiry date, but "45" probably won't work. Use the expiration date of a real contract.

Re: contractNext() not working? [Re: jcl] #476206
02/04/19 14:09
02/04/19 14:09
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline OP
Junior Member
mhdus  Offline OP
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
ah, indeed, RTFM, sorry blush
I got fooled by the fact that the contract() function is overloaded to accept both, an expiry date OR days to expiration, while contractNext() can only handle an expiry date. Thanks!


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1