|
2 registered members (Ayumi, kzhao),
1,354
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
EXITRUN only in simulations?
#473336
06/29/18 15:21
06/29/18 15:21
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
OP
User
|
OP
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
Trying to collect some information while trading and saving them after finishing the strategy, mostly done by pressing the Stop button. I thought this could be done in a for(all_trades) loop in EXITRUN but surprisingly this does not work. EXITRUN Last run of the simulation. All trades are closed. [...] Really only in simulations? Is there any function to use in live trading?
|
|
|
Re: EXITRUN only in simulations?
[Re: Sphin]
#473349
06/30/18 12:17
06/30/18 12:17
|
Joined: Sep 2017
Posts: 235
Hredot
Member
|
Member
Joined: Sep 2017
Posts: 235
|
I see, here is a hacky way:
...
if(file_date("your\path\stop.txt")>0){
... save data here ...
}
...
Create stop.txt shortly before stopping the script, and delete it right after.
|
|
|
Re: EXITRUN only in simulations?
[Re: Hredot]
#473351
06/30/18 16:35
06/30/18 16:35
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
OP
User
|
OP
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
Quick and dirty, I use a lot of such solutions! Create stop.txt shortly before stopping the script, and delete it right after. Hmm ... but instead of creating the stop.txt shortly before stopping the script I could also execute the for(all_trades) loop - if I only knew when the time is "shortly before stopping the script" but this is the time in question.
|
|
|
|
|
|