2 registered members (Quad, AndrewAMD),
410
guests, and 0
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
Support
|
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.htmWhen 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
MatPed
User
|
User
Joined: Feb 2015
Posts: 652
Milano, Italy
|
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]
#473368
07/01/18 16:59
07/01/18 16:59
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
OP
User
|
OP
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
To give an example, what I'm doing is simply:
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: Spirit]
#473391
07/02/18 16:01
07/02/18 16:01
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
OP
User
|
OP
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
users would not expect that a button named "stop" starts a new run No one would expect it, me neither. 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? 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:
void cleanup() {
for(all_trades)
print(TO_CSV, "%s, %s, %.1f, %.2fn", strdate("%y%m%d %H:%M:%S", TradeEnterTime), Asset, SpecialKey, TradeProfit);
}
|
|
|
|