Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (rki), 405 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
new contractCPD function crashes in main() at bar 0 #476236
02/06/19 17:17
02/06/19 17:17
Joined: Nov 2017
Posts: 17
T
Tamas Offline OP
Newbie
Tamas  Offline OP
Newbie
T

Joined: Nov 2017
Posts: 17
Hi,
I don't seem to be able to trace what's wrong here. The new contractCPD function (as explained on the financial-hacker's new blog) seems to be crashing with the below message, here is the diagnostic information. I can't get more details from the contractCPD function...

I am using the script as it is from the 2018 repository and have data subscription to the followings:

CME Real-Time
COMEX Real-Time
IEX Depth of Book
NYSE Arca Options
US Equity and Options Add-On Streaming Bundle
US Reg NMS Snapshot
US Securities Snapshot and Futures Value Bundle

Here is the trace information:

Load AssetsIB
Open: HistoryAssetsIB.csv rb
Load SPY
BrokerAsset SPY:
BrokerAsset SPY: : 272.7700 11400.162800 ms
!SPY: 272.77000 0.03000 1
Alloc SPY prices
SPY: 0..8765
Asset SPY status SPY:L 182818200 1
Asset SPY status SPY:S 182818200 1
!Get Option Chain SPY-OPT--0--SMART--USD
Chain of 3243 SPY contracts
3243 contracts today
Current price 272.77
Wait time approx 17 minutes
BrokerAsset
Error 111: Crash in function: main() at bar 0

Any help would be much appreciated.

Re: new contractCPD function crashes in main() at bar 0 [Re: Tamas] #476237
02/06/19 17:41
02/06/19 17:41
Joined: Nov 2017
Posts: 17
T
Tamas Offline OP
Newbie
Tamas  Offline OP
Newbie
T

Joined: Nov 2017
Posts: 17
And yes, I am using Zorro 2.01.6.

Re: new contractCPD function crashes in main() at bar 0 [Re: Tamas] #476238
02/06/19 18:26
02/06/19 18:26
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Post your script.

Re: new contractCPD function crashes in main() at bar 0 [Re: AndrewAMD] #476240
02/06/19 20:47
02/06/19 20:47
Joined: Nov 2017
Posts: 17
T
Tamas Offline OP
Newbie
Tamas  Offline OP
Newbie
T

Joined: Nov 2017
Posts: 17
// Get today's market sentiment //////////////////////////////////////

void main()
{
Verbose = 31;
if(version() < 1.98 || !is(TRADEMODE) || Broker != "IB") {
printf("Need Zorro 1.99+ in IB Trade Mode!");
return;
}
StartDate = NOW;
LookBack = 0;
assetList("AssetsIB");
asset("SPY");

// load today's contract chain
contractUpdate(0,0,CALL|PUT);
printf("n%i contracts today",NumContracts);
if(!NumContracts) return;

// get min and max strike
contract(CALL,45,0);
var StrikeMin = ContractStrike;
contract(CALL,45,9999);
var StrikeMax = ContractStrike;
printf("nStrike range %.2f...%.2f",StrikeMin,StrikeMax);

// get underlying price
var Price,Current = priceClose(0);
printf("nCurrent price %.2f",Current);

// plot CPD histogram
printf("nWait time approx %i minutes",1+NumContracts/200);
contractCPD(45);
int N = 0;
for(Price = 0.75*Current; Price <= 1.25*Current; N++,Price += 0.01*Current) {
if(N == 25)
plotBar("Current",N,floor(Price),cpd(Price),BARS|LBL2,BLACK);
else
plotBar("CPD",N,floor(Price),cpd(Price),BARS|LBL2,RED);
}
printf("nExpected price %.2f",cpdv(50));
}

Re: new contractCPD function crashes in main() at bar 0 [Re: Tamas] #476243
02/07/19 08:43
02/07/19 08:43
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Zorro beta 2.01 had a bug when retrieving price quotes from the broker. This could be probably the reason of the crash. Please wait for the next beta version 2.02, then test again. If it then still crashes, please post again and I'll look into it.

Re: new contractCPD function crashes in main() at bar 0 [Re: jcl] #476247
02/07/19 09:35
02/07/19 09:35
Joined: Nov 2017
Posts: 17
T
Tamas Offline OP
Newbie
Tamas  Offline OP
Newbie
T

Joined: Nov 2017
Posts: 17
Thanks! Will do!


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1