Timer Help

Hi, I am new to CloudQuant and was wondering if someone can let me know what is wrong with my timer code below. I want it to print "foo" every day at 9:45, but currently it is not printing anything. Thanks!

from cloudquant.interfaces import Strategy, Event
class TimerTest(Strategy):

def on_start(self, md, order, service, account):
    service.add_time_trigger(service.time(9, 45))
def on_timer(self, event, md, order, service, account):
    print "foo"

Comments

  • rp513226rp513226 Posts: 2

    Also, the docs page for add_time_trigger() gives me an error. Is this no longer supported? Or maybe it is only supported in CQ Elite?
    https://app.cloudquant.com/#/glossary/153

  • db402220db402220 Posts: 1

    When you run a backtest on your script, do you have "Enable Fast Simulation checked"? I think it's on by default. With Fast Simulation, timer events are not simulated, so you should turn this off to see the timer event fire.

  • shayneshayne Posts: 70

    rp513226,

    You are correct on_timer() is not available in cq lite. Also, the documentation is tailored to your permissions. I recommend asking to be upgraded to Elite.

    -Shayne

Sign In or Register to comment.