tick() - loop and execution during weekend

Posted By: Sphin

tick() - loop and execution during weekend - 02/11/18 18:53

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
Posted By: jcl

Re: tick() - loop and execution during weekend - 02/12/18 08:56

Weekend = 3 should prevent it.

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

Re: tick() - loop and execution during weekend - 02/12/18 16:32

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.
Posted By: jcl

Re: tick() - loop and execution during weekend - 02/13/18 09:27

In the backtest, or in live trading?
Posted By: Sphin

Re: tick() - loop and execution during weekend - 02/13/18 17:23

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.
Posted By: jcl

Re: tick() - loop and execution during weekend - 02/14/18 07:56

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.
Posted By: Sphin

Re: tick() - loop and execution during weekend - 02/14/18 17:26

Thanks, this workaround will do it!
© 2024 lite-C Forums