Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Crash in simple script with many trades per bar #446560
10/21/14 03:03
10/21/14 03:03
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
The following (silly) strategy Tested against AUD/USD using the official downloaded History dies for Error 111: Crash in script. at Bar 12034.

Why?
Code:
function run() {
  StartDate = 20090901;
  EndDate = 20140901;
  BarPeriod = 60;
  Hedge = 2;
  TradesPerBar = 256;

  var atrx = ATR(200);
  Stop = atrx * 3.0;
  Trail = atrx * 1.0;
  TrailLock = 50;
  int trade_num;
  for (trade_num = 0; trade_num < 147; trade_num++) {
    enterLong();
  }
}


Re: Crash in simple script with many trades per bar [Re: GPEngine] #446561
10/21/14 03:06
10/21/14 03:06
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
If you change StartDate = 20090901; to StartDate = 20090101; you get a BADFREE2: TR as a bonus at Bar # 23993.

How could such a simple script go so wrong?

Re: Crash in simple script with many trades per bar [Re: GPEngine] #446567
10/21/14 10:40
10/21/14 10:40
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Thanks! The script looks perfectly normal and should not crash, yet it does - most likely due to the extreme number of trades. They will probably exceed the free memory. But it should then stop with an error message, instead of a crash. I'll forward this to the developers for fixing.

Re: Crash in simple script with many trades per bar [Re: jcl] #446573
10/21/14 14:24
10/21/14 14:24
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
You're welcome!

What about the possibility of having Zorro survive this script rather than throwing an error or crashing?

Here's my use case
I am asking Zorro to compose a report which studies the outcomes of trades across several possible values of Stop, Trail, and TrailLock (and Entry too if it weren't for Bug Duplicate elements in all_trades w/ Entry + EntryTime limits) at every bar. I would like Zorro to collect the data for this report in a single pass through the History. Admittedly, it is easy to hit a combinatorial explosion with this plan. But, 147 trades per bar is an unworkably low limit.

Re: Crash in simple script with many trades per bar [Re: GPEngine] #446601
10/22/14 17:06
10/22/14 17:06
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
The limit is far lower than 147 trades: it is 500 MB contiguous memory. For speed reason, trades are allocated before the simulation, not at runtime.

A possible solution would be a special "GPEngine mode" that allocates trades at runtime, or deletes trades when they are closed. In the former case the simulation would run noticably slower, in the latter case some statistics are not available, and OptF can not be calculated.


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