Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, AndrewAMD), 410 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: EXITRUN only in simulations? [Re: Sphin] #473362
07/01/18 14:10
07/01/18 14:10
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
No, Exitrun is a flag that is set when Zorro starts its last run:

http://manual.zorro-project.com/is.htm

When you hit stop you want no exit run. Imagine the script places wrong trades or the market crashes, so you hit stop, then you dont want it to continue for another run.

Re: EXITRUN only in simulations? [Re: Petra] #473363
07/01/18 14:56
07/01/18 14:56
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline
User
MatPed  Offline
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Originally Posted By: Petra
I hope they dont, because when I hit stop I want it to stop, not to start another run. There must be a better solution.


Hi Petra,
Can you explain why having a function activated pressing the STOP button pressed should be a bad thing?
I do not get it. Thank You

Re: EXITRUN only in simulations? [Re: MatPed] #473365
07/01/18 15:39
07/01/18 15:39
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
You think its no bad thing when Stop starts another run with possibly new trades? You must be very rich! laugh laugh

Re: EXITRUN only in simulations? [Re: Petra] #473366
07/01/18 15:47
07/01/18 15:47
Joined: Sep 2017
Posts: 235
H
Hredot Offline
Member
Hredot  Offline
Member
H

Joined: Sep 2017
Posts: 235
EXITRUN should be special, where only functions wrapped in if(is(EXITRUN)){...} get executed. There, problem solved.

Re: EXITRUN only in simulations? [Re: Petra] #473367
07/01/18 16:06
07/01/18 16:06
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline
User
MatPed  Offline
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Originally Posted By: Petra
You think its no bad thing when Stop starts another run with possibly new trades? You must be very rich! laugh laugh


that's not an answer. If you have a function you can use it well, wrong or do not use it at all.

Re: EXITRUN only in simulations? [Re: MatPed] #473368
07/01/18 16:59
07/01/18 16:59
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
To give an example, what I'm doing is simply:
Code:
if(is(EXITRUN)) 		
  	for(all_trades) 
  		print(TO_CSV, "%s, %s, %.1f, %.2fn", strdate("%y%m%d %H:%M:%S", TradeEnterTime), Asset, SpecialKey, TradeProfit);


Means after the last run Zorro prints to CSV each trade together with a special key number (TradeVar). No restart of run or what ever, only printing trade results to CSV.

Or like MatPed said: you are not forced to use this function.

Re: EXITRUN only in simulations? [Re: Sphin] #473373
07/01/18 22:34
07/01/18 22:34
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
I think the chance of such a "feature" is zero, because it would be not backwards compatible and users would not expect that a button named "stop" starts a new run. Why not using simply the evaluate or cleanup function?

Re: EXITRUN only in simulations? [Re: Spirit] #473391
07/02/18 16:01
07/02/18 16:01
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Quote:
users would not expect that a button named "stop" starts a new run

No one would expect it, me neither.

Quote:
Why not using simply the evaluate or cleanup function?

With pleasure. Could you please give me a hint how to call a function after the end of trading the with the evaluate function?

Quote:
From the manual:
For globally allocated memory areas, define a void cleanup() function that releases memory. The function will be automatically called at end or termination of the session.

Does this work:
Code:
void cleanup() {
   for(all_trades) 
  	print(TO_CSV, "%s, %s, %.1f, %.2fn", strdate("%y%m%d %H:%M:%S", TradeEnterTime), Asset, SpecialKey, TradeProfit);
}


Re: EXITRUN only in simulations? [Re: Sphin] #473413
07/03/18 16:23
07/03/18 16:23
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Amazing, with cleanup() at least a "hello-world-csv" is created when the stop button is hit. If the trade history is still present this moment I can indeed use it as a workaround for EXITRUN in trade mode.

Page 2 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1