Gamestudio Links
Zorro Links
Newest Posts
New Zorro version 2.03
by laz
12 minutes 38 seconds ago
Texture Shifting
by Superku
13 minutes 26 seconds ago
What are you working on?
by Superku
30 minutes 55 seconds ago
About strategy optimization
by Spirit
Today at 14:13
Help in analysis...
by MINER
Today at 09:56
TradeVars not working with pending trades
by jcl
Today at 08:17
Creating a Directory
by txesmi
Yesterday at 10:15
AUM Magazine
Latest Screens
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Who's Online
16 registered (Ayumi, kvm, Dalla, Quad, GPEngine, alibaba, Iglarion, misiek, 3 invisible), 640 Guests and 7 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Pelin27, Aziz, lucianopneto, j45p41, Max_Ahn
18173 Registered Users
Topic Options
Rate This Topic
#476244 - 02/07/19 09:48 Bar = NumBars results in Error030
gamadeus Offline
Newbie

Registered: 11/27/18
Posts: 40
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.

Top
#476245 - 02/07/19 10:11 Re: Bar = NumBars results in Error030 [Re: gamadeus]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26747
Loc: 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?

Top
#476246 - 02/07/19 10:19 Re: Bar = NumBars results in Error030 [Re: jcl]
gamadeus Offline
Newbie

Registered: 11/27/18
Posts: 40
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?


Edited by gamadeus (02/07/19 10:21)

Top
#476249 - 02/07/19 13:48 Re: Bar = NumBars results in Error030 [Re: gamadeus]
gamadeus Offline
Newbie

Registered: 11/27/18
Posts: 40
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?


Edited by gamadeus (02/07/19 13:48)

Top
#476255 - 02/08/19 09:17 Re: Bar = NumBars results in Error030 [Re: gamadeus]
gamadeus Offline
Newbie

Registered: 11/27/18
Posts: 40
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

Top
#476268 - 02/09/19 08:16 Re: Bar = NumBars results in Error030 [Re: gamadeus]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26747
Loc: 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.

Top
#476280 - 02/10/19 13:00 Re: Bar = NumBars results in Error030 [Re: jcl]
gamadeus Offline
Newbie

Registered: 11/27/18
Posts: 40
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?

Top
#476283 - 02/11/19 08:20 Re: Bar = NumBars results in Error030 [Re: gamadeus]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26747
Loc: Frankfurt
Yes, I would also expect that it proceeds to the next cycle. I'll forward this to the developers for looking into it.

Top
#476284 - 02/11/19 18:34 Re: Bar = NumBars results in Error030 [Re: jcl]
gamadeus Offline
Newbie

Registered: 11/27/18
Posts: 40
ok thanks, I tested it on 1.96 and 2.02 btw.

Top



Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de