Skip to content

ChartObjectsMovingEventArgs

class cAlgo.API Since 5.2

DesktopCLICloud

Provides data for the chart objects moving event.

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (ChartArea.ObjectsMoving).

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (ChartArea.ObjectsMoving).

Definition

public class ChartObjectsMovingEventArgs : ChartObjectsEventArgs

Namespace: cAlgo.API · Group: EventArgs · Inherits: ChartObjectsEventArgs

Examples

protected override void OnStart()
{
    Chart.ObjectsMoving += OnChartObjectsMoving;
}

private void OnChartObjectsMoving(ChartObjectsMovingEventArgs args)
{
    foreach (var chartObject in args.ChartObjects)
    {
        if (chartObject is ChartHorizontalLine line)
            Chart.DrawStaticText("movingPrice", "Line price: " + line.Y, VerticalAlignment.Top, HorizontalAlignment.Right, Color.White);
    }
}
def on_start(self):
    api.Chart.ObjectsMoving += self.on_chart_objects_moving

def on_chart_objects_moving(self, args):
    for chartObject in args.ChartObjects:
        api.Chart.DrawStaticText("movingObject", f"Moving: {chartObject.Name}", VerticalAlignment.Top, HorizontalAlignment.Right, Color.White)

Inherited members

From ChartObjectsEventArgs: Chart, Area, ChartObjects

See also