Skip to content

FavoriteTimeFrames.Removed

event · FavoriteTimeFrames · cAlgo.API Since 5.3

DesktopCLICloud

Occurs when TimeFrames are removed from favorite TimeFrames.

Environment behaviour

CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.

Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.

Definition

event Action<FavoriteTimeFramesRemovedEventArgs> Removed;
favoriteTimeFrames.Removed += handler  # handler(obj: FavoriteTimeFramesRemovedEventArgs)

Examples

protected override void OnStart()
{
    TimeFrameManager.Favorite.Removed += OnFavoriteTimeFramesRemoved;
}

private void OnFavoriteTimeFramesRemoved(FavoriteTimeFramesRemovedEventArgs args)
{
    foreach (var timeFrame in args.TimeFrames)
        Print("Removed from favorites: {0}", timeFrame.Name);
}
def on_start(self):
    api.TimeFrameManager.Favorite.Removed += self.on_favorite_time_frames_removed

def on_favorite_time_frames_removed(self, args):
    for timeFrame in args.TimeFrames:
        api.Print(f"Removed from favorites: {timeFrame.Name}")