Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
tick() - loop and execution during weekend #470894
02/11/18 18:53
02/11/18 18:53
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
loop() is not present in tick()? I get an "Error 041: Invalid call in TMF!"
Is there a chance to prevent the tick() function from being executed during weekends?

Thanks, Sphin

Re: tick() - loop and execution during weekend [Re: Sphin] #470898
02/12/18 08:56
02/12/18 08:56
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Weekend = 3 should prevent it.

Loop is a special function and cannot be used in ticks. Use a normal for or while loop instead.

Re: tick() - loop and execution during weekend [Re: jcl] #470908
02/12/18 16:32
02/12/18 16:32
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Sorry, I forgot to mention that I tried Weekend = 3 already, it seems to have no effect to the tick function. Therefore I asked at all.

Re: tick() - loop and execution during weekend [Re: Sphin] #470921
02/13/18 09:27
02/13/18 09:27
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
In the backtest, or in live trading?

Re: tick() - loop and execution during weekend [Re: jcl] #470943
02/13/18 17:23
02/13/18 17:23
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
In live trading in an experiment with BrokerArb. One of the brokers quotes prices for crypto assets throughout the whole weekend while the other broker does not and of course there is soon a nice price difference which is alerted all time by the tick function.

Re: tick() - loop and execution during weekend [Re: Sphin] #470951
02/14/18 07:56
02/14/18 07:56
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Ok, we'll check that. For ensuring that no quote is processed, enter at the begin of the tick function a line like: if(!workday(0)) return;

Update: Yes, tick() is still active on Weekend = 3. My first answer was wrong.

Re: tick() - loop and execution during weekend [Re: jcl] #470970
02/14/18 17:26
02/14/18 17:26
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Thanks, this workaround will do it!


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1