Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 07/09/25 13:41
SGT_FW
by Aku_Aku. 07/09/25 10:00
Online Gamestudio manual is down
by AndrewAMD. 07/01/25 18:04
anyone currently using IB gateway??
by SBGuy. 06/30/25 20:02
Zorro Gives Wrong Spread
by AndrewAMD. 06/24/25 16:51
AUM Magazine
Latest Screens
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Zeal-X2
Who's Online Now
2 registered members (3run, Quad), 292 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ledfoot, liu, LoT, LukeToday, aaaddasaaaadaaa
19145 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
IBKR datasave problem #488768
06/09/25 15:15
06/09/25 15:15
Joined: Jun 2025
Posts: 2
N
NewbieZorro Offline OP
Guest
NewbieZorro  Offline OP
Guest
N

Joined: Jun 2025
Posts: 2
It is not possible with datasave to store the option chain on my computer. The options are downloaded but not stored.
This is the error message:

!Open IB Socket 3.16
!Account XXXXXXXXXXXXX, at UTC 06-09 14:57
Downloading options for SPX...
!Get Chain SPX-OPT--0.00--SMART/--USD..
Chain of 23763 SPX contracts
Saved 0 option contracts for SPX to History\SPX_Options_-760358231088839475-76035823.t8

I verified this:
Datasave works (tested with artificial options creating)
IBKR is connected correctly, api connection green and accepted
Directory is writable
Subscribed to SPX option data

Any suggestions?

// SPX Option Chain Downloader for Zorro + IBKR
#include <contract.c>

function run()
{
BarPeriod = 1440;
LookBack = 0;
StartDate = NOW;
set(LOGFILE);

assetList("AssetsIB");
asset("SPX");
Multiplier = 100;

printf("\nDownloading options for %s...", Asset);

// Download option chain (CALLs + PUTs)
if (!contractUpdate(Asset, 0, CALL|PUT)) {
printf("\nError: Failed to download option chain for %s", Asset);
quit("Download failed.");
return;
}

// Build filename with date
string filename = strf("History\\%s_Options_%04d%02d%02d.t8",
Asset, wdate(1), wdate(2), wdate(3));

// Save contracts to file
int saved = dataSave(1, filename);
printf("\nSaved %d option contracts for %s to %s", saved, Asset, filename);

quit("Download complete.");
}

Re: IBKR datasave problem [Re: NewbieZorro] #488769
06/09/25 19:43
06/09/25 19:43
Joined: Feb 2017
Posts: 1,800
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,800
Chicago
You successfully loaded the option chain to memory.

But then you tried to save dataset #1 to file. Dataset #1 doesn't exist. The problem is that the option chain is not a dataset.

Side note: Your attempt to define a string for the t8 file makes no sense. wdate() returns double, but your string format demands an int.

What exactly were you hoping the t8 file would contain? FYI, the contract chain does not contain historical data.

Re: IBKR datasave problem [Re: NewbieZorro] #488771
06/11/25 15:11
06/11/25 15:11
Joined: Jun 2025
Posts: 2
N
NewbieZorro Offline OP
Guest
NewbieZorro  Offline OP
Guest
N

Joined: Jun 2025
Posts: 2
Thank you so much for your assistance.

I’m completely new to coding, but I’m determined to automate my option screening processes. Unfortunately, I haven’t found any existing software or service that fits my specific strategies, so I’ve decided to build my own solution.

Any additional advice, resources, or direction you could offer would be incredibly helpful as I embark on this learning journey.

Thanks again for your time and expertise!

Re: IBKR datasave problem [Re: NewbieZorro] #488773
06/13/25 09:42
06/13/25 09:42
Joined: Mar 2022
Posts: 21
Frankfurt am Main
B
BrainSailor Offline
Newbie
BrainSailor  Offline
Newbie
B

Joined: Mar 2022
Posts: 21
Frankfurt am Main
I am mostly doing put credit spreads. I enter and exit them manually but I monitor my positions with zorro. Drop me a pm if you are interested in getting in touch.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1