Ticks.HistoryLoaded
event · Ticks · cAlgo.API
DesktopCLICloud
Occurs when more history is loaded due to chart scroll to the left or due to API call.
Definition
event Action<TicksHistoryLoadedEventArgs> HistoryLoaded;
ticks.HistoryLoaded += handler # handler(obj: TicksHistoryLoadedEventArgs)
Examples
private Ticks _ticks;
protected override void OnStart()
{
_ticks = MarketData.GetTicks();
_ticks.HistoryLoaded += OnTicksHistoryLoaded;
_ticks.LoadMoreHistoryAsync();
}
private void OnTicksHistoryLoaded(TicksHistoryLoadedEventArgs args)
{
Print("{0} older ticks loaded, total: {1}", args.Count, args.Ticks.Count);
}
def on_start(self):
self.ticks = api.MarketData.GetTicks()
self.ticks.HistoryLoaded += self.on_ticks_history_loaded
self.ticks.LoadMoreHistoryAsync()
def on_ticks_history_loaded(self, args):
api.Print(f"{args.Count} older ticks loaded, total: {args.Ticks.Count}")