Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by Ayumi
8 minutes 11 seconds ago
Performance report on the imported trades
by OptimusPrime
15 minutes 30 seconds ago
Possible to return character vector from R bridge?
by JamesHH
Today at 18:59
Help with Wine on Linux
by AndrewAMD
Today at 16:59
Stock Splits
by AndrewAMD
Today at 16:23
Linux - Help with setting up with Wine and Zorro
by michaelj
Today at 04:49
How to expand Zorro to work with other broker ( like Tradovate )
by AndrewAMD
Today at 02:12
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
12 registered (AndrewAMD, Ayumi, JamesHH, ChrstphFr, michaelj, Akow, jenGs, Bill_Lin_Fang, alibaba, 1 invisible), 165 Guests and 8 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Bill_Lin_Fang, michaelj, ThePituLegend, kankan, Nofip
18207 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 Online

Chief Engineer

Registered: 07/22/00
Posts: 26839
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 thats 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 Online

Chief Engineer

Registered: 07/22/00
Posts: 26839
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");
}

Isnt 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 Online

Chief Engineer

Registered: 07/22/00
Posts: 26839
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