Skip to content

ChartActivationChangedEventArgs

class cAlgo.API

DesktopCLICloud

Provides data for chart activated/deactivated events

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (Chart.Activated, Chart.Deactivated).

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (Chart.Activated, Chart.Deactivated).

Definition

public class ChartActivationChangedEventArgs

Namespace: cAlgo.API · Group: EventArgs

Examples

protected override void OnStart()
{
    Chart.Activated += OnChartActivationChanged;
    Chart.Deactivated += OnChartActivationChanged;
}

private void OnChartActivationChanged(ChartActivationChangedEventArgs args)
{
    Print("Chart {0} {1} is active: {2}", args.Chart.SymbolName, args.Chart.TimeFrame, args.Chart.IsActive);
}
def on_start(self):
    api.Chart.Activated += self.on_chart_activation_changed
    api.Chart.Deactivated += self.on_chart_activation_changed

def on_chart_activation_changed(self, args):
    api.Print(f"Chart {args.Chart.SymbolName} {args.Chart.TimeFrame} is active: {args.Chart.IsActive}")

Properties

Name Description
ChartDesktopCLICloudChart The chart that event belongs to

See also