Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Nymphodora, AndrewAMD, TipmyPip, Quad, Imhotep), 847 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Bar = NumBars results in Error030 #476244
02/07/19 08:48
02/07/19 08:48
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
When I set Bar = NumBars according to the manual to abort the simulation I get an Error030. Is that supposed to happen?

Bar=Endbar works too, but then the last bar still gets executed, so its less clean.

Re: Bar = NumBars results in Error030 [Re: gamadeus] #476245
02/07/19 09:11
02/07/19 09:11
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Bar = NumBars is an unusual way to abort the simulation. Normally you call quit(). ON which manual page have you found this? And can you post your code?

Re: Bar = NumBars results in Error030 [Re: jcl] #476246
02/07/19 09:19
02/07/19 09:19
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
Dont know which Page, but you can find it in Help if you query NumBars.

It says:
...... Setting Bar = NumBars aborts the simulation. Use this hack at own risk since TimeFrame and series do not consider bars that are skipped this way.

My code can be found in the thread I started before "LookBack and StartBar"
Its really nothing fancy, just testing and printing Bar and timestamps.

Thanks anyway for the tip! The only problem with quit() is that it is not calling objective or evaluate functions, it seems. Any way around that?

Last edited by gamadeus; 02/07/19 09:21.
Re: Bar = NumBars results in Error030 [Re: gamadeus] #476249
02/07/19 12:48
02/07/19 12:48
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
Ok according to the manual quit sets the EXITRUN flag and calls evaluate, so that’s fine

Unfortunately an even bigger problem is that it stops all cycles too. According to the manual it continues with the next cycle if a text is added as function parameter. However that does not seem to work, quit always results in a dead stop.
Is that information correct?

Last edited by gamadeus; 02/07/19 12:48.
Re: Bar = NumBars results in Error030 [Re: gamadeus] #476255
02/08/19 08:17
02/08/19 08:17
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
jcl can you please let me know if quit() is supposed to work as advertised in the manual, i.e. call the next cycle if a text is given?
or is that only working for Zorro S now?
that would really really be helpful for what I am trying to do

meanwhile I am trying to work with:

for(open_trades) exitTrade(ThisTrade);
Bar = EndBar;
return;

but this is much less clean and causes problems

Re: Bar = NumBars results in Error030 [Re: gamadeus] #476268
02/09/19 07:16
02/09/19 07:16
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Yes, quit is supposed to work as described and has nothing to do with Zorro S. But setting Bar is indeed an ugly hack. I'll remove that from the manual. If you have problems with quit, you can contact Support with your script and they'll look into it.

Re: Bar = NumBars results in Error030 [Re: jcl] #476280
02/10/19 12:00
02/10/19 12:00
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
Thanks jcl.
That problem with quit really has nothing to do with my script.

Here is a sample script which is as basic as it can get. I would expect this to run 4 times but it only runs once:

function run()
{
NumTotalCycles = 4;
if(tod() == 400) quit("its 4 am");
}

Isn´t quit supposed to call the next TotalCycle with a setup like this?

Re: Bar = NumBars results in Error030 [Re: gamadeus] #476283
02/11/19 07:20
02/11/19 07:20
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Yes, I would also expect that it proceeds to the next cycle. I'll forward this to the developers for looking into it.

Re: Bar = NumBars results in Error030 [Re: jcl] #476284
02/11/19 17:34
02/11/19 17:34
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
ok thanks, I tested it on 1.96 and 2.02 btw.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1