tock() function

Posted By: jdubya27

tock() function - 05/04/20 03:11

Hello,

I am running Zorro 2.26. I am using the tock() function to output data to a file and experience some odd behavior. When the strategy starts it executes code in tock() once creating my output file. It should then output again after 60,000ms (1m), but it does not. At first I thought it only ran once, but after letting my script run for a while, I noticed tock() started working. I have this in several different scripts and some of them have different BarPeriods. What i believe is happening, is tock() runs at first (initial run), but then not again until the after the BarPeriod. For example in a script with a BarPeriod 10, tock() starts running again after 10min and the consistently runs every 60,000ms. So the issue seems to be betwen the script start and the BarPeriod, once the barperiod has passed, it runs as expected. I have some scripts that have Barperiod 60 and some 1440, so this is not ideal. I would assume tock() runs every 60,000ms from the start of the script. I have my tock() function in the section of the code just above the run() function. I have verified if i change tock() to tick() it does work as expected - every tick. So the issue seems to be specific to tock().

Either a bug, or I'm misunderstanding how to use tock().

Thanks
Josh
Posted By: jcl

Re: tock() function - 05/04/20 13:27

I would also expect that tock runs every minute even before the first bar period. Thanks for the info, I'll forward this to the developers for looking into it.
© 2024 lite-C Forums