Plugin.Timer
property · Plugin · cAlgo.API
DesktopCLICloud
Access to the Timer object.
Environment behaviour
CLI — not supported. Plugins cannot run in the CLI: ctrader-cli runs cBots only.
Cloud — not supported. Plugins cannot run in the cloud: it runs cBots only.
Definition
public Timer Timer {get;}
api.Timer: Timer
Returns Timer
Examples
protected override void OnStart()
{
Timer.Start(1);
}
protected override void OnTimer()
{
Print("Server time: {0:HH:mm:ss}", Server.Time);
}
def on_start(self):
api.Timer.Start(1)
def on_timer(self):
api.Print(f"Server time: {api.Server.Time}")