ActiveFrameChangedEventArgs
class cAlgo.API
DesktopCLICloud
Provides data for the active frame changed event.
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
public class ActiveFrameChangedEventArgs
Namespace: cAlgo.API · Group: EventArgs
Examples
protected override void OnStart()
{
ChartManager.ActiveFrameChanged += OnActiveFrameChanged;
}
private void OnActiveFrameChanged(ActiveFrameChangedEventArgs args)
{
var oldFrameId = args.OldFrame?.Id ?? "none";
var newFrameId = args.NewFrame?.Id ?? "none";
Print("Active frame changed from {0} to {1}", oldFrameId, newFrameId);
}
def on_start(self):
api.ChartManager.ActiveFrameChanged += self.on_active_frame_changed
def on_active_frame_changed(self, args):
old_frame_id = args.OldFrame.Id if args.OldFrame is not None else "none"
new_frame_id = args.NewFrame.Id if args.NewFrame is not None else "none"
api.Print(f"Active frame changed from {old_frame_id} to {new_frame_id}")
Properties
| Name | Description |
|---|---|
NewFrameDesktopCLICloudFrame | Returns the new active frame or null. |
OldFrameDesktopCLICloudFrame | Returns the old / previous active frame or null. |