Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, TipmyPip, 7th_zorro), 877 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Crash in script when optimizing #421977
04/29/13 16:30
04/29/13 16:30
Joined: Apr 2013
Posts: 35
J
Joaquin Offline OP
Newbie
Joaquin  Offline OP
Newbie
J

Joined: Apr 2013
Posts: 35
I am fresh new with Zorro. I have developed my very first strategy and seems to work fine, it opens pending orders and updates Trailing Stops correctly.
But I am trying now optimization.
I have set this at the beginning of the script:

set(PARAMETERS);
BarPeriod = 1440;
//...
var sl = optimize(1,0.1,1,0.1) * diff;

And when I click in Train, after some time an error popup emerges saying "Crash in script" and this message is shown in the logs window:
"Parameter 1 step 1: 0.10 => 0.34 52/579"

Any clue why this happens?

Thanks, Zorro is a great tool!

Re: Crash in script when optimizing [Re: Joaquin] #421984
04/29/13 20:51
04/29/13 20:51
Joined: Apr 2013
Posts: 35
J
Joaquin Offline OP
Newbie
Joaquin  Offline OP
Newbie
J

Joined: Apr 2013
Posts: 35
I have noticed that this crash is due to not enough bars to 'learn' to use in the optimization. Is that possible? The script works with 1day bars (barperiod 1440), and if I tune lookback and try different -smaller- timeframes, this error stops emerging.

But, what can I do to make this script working in barperiod 1440 and make optimizations? How can I know how many lookback bars the script needs for calculations?

Thanks to everyone reading this.

Re: Crash in script when optimizing [Re: Joaquin] #421998
04/30/13 07:50
04/30/13 07:50
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Welcome to the forum. The settings above look normal, so they can by itself not cause a crash. The reason must be somewhere else. Can you post the whole script? Use PM if it's a secret strategy. We'll look into it and fix that crash.

Re: Crash in script when optimizing [Re: jcl] #422004
04/30/13 08:27
04/30/13 08:27
Joined: Apr 2013
Posts: 35
J
Joaquin Offline OP
Newbie
Joaquin  Offline OP
Newbie
J

Joined: Apr 2013
Posts: 35
Hi jcl, thanks for the welcome
You're doing an excellent work with this tool, I am beginning to love it!
It seems it was a just an error 'in my side' (the side just in front of the screen) :-)

I come from MetaTrader and things are very different here, I'll just have to get used to it!

I have overwritten the old script, and now it works correctly. I think that the crash I was having could be coming from these sentences:

enterLong(0.1,Close+diff,Close+diff-sl,Close+diff+tp,trailing,50);
enterShort(0.1,Close-diff,Close-diff+sl,Close-diff-tp,trailing,50);

I have modified the script, setting the Stop, TakeProfit and Trail variables before calling enterLong() and enterShort() and now it doesn't crash.

Anyway, thanks for your help!

Re: Crash in script when optimizing [Re: Joaquin] #422061
05/01/13 06:45
05/01/13 06:45
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
You can set Stop etc. also in enterLong. The crash was probably caused by the "0.1" - if you don't give an integer here, enterLong assumes that it's a pointer to a trade function, calls a nonexistent function, and consequently crashes.


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