Gamestudio Links
Zorro Links
Newest Posts
no trade when there is a negative trained WFOcycle
by maxwellreturn. 08/24/19 22:33
Skip Stepcycle
by maxwellreturn. 08/24/19 22:27
Script filename
by MatPed. 08/24/19 20:49
Any Old Timers Still Around?
by pyramide. 08/24/19 18:23
Oanda FIFO issue?
by AndrewAMD. 08/24/19 12:10
IG plugin initial release
by Dalla. 08/24/19 06:06
Tutorial for Vector Graphics
by Dooley. 08/23/19 22:32
Issue with dataParse function
by byakuren81. 08/23/19 21:57
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
1 registered members (AndrewAMD), 633 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Ysbail, trader4321, GorgonzolaBYTE, Southqvist, tawin
18272 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: 48
G
gamadeus Offline OP
Newbie
gamadeus  Offline OP
Newbie
G

Joined: Nov 2018
Posts: 48
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: 26,996
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 26,996
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: 48
G
gamadeus Offline OP
Newbie
gamadeus  Offline OP
Newbie
G

Joined: Nov 2018
Posts: 48
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: 48
G
gamadeus Offline OP
Newbie
gamadeus  Offline OP
Newbie
G

Joined: Nov 2018
Posts: 48
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: 48
G
gamadeus Offline OP
Newbie
gamadeus  Offline OP
Newbie
G

Joined: Nov 2018
Posts: 48
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: 26,996
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 26,996
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: 48
G
gamadeus Offline OP
Newbie
gamadeus  Offline OP
Newbie
G

Joined: Nov 2018
Posts: 48
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: 26,996
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 26,996
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: 48
G
gamadeus Offline OP
Newbie
gamadeus  Offline OP
Newbie
G

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


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