---
id: "T:cAlgo.API.ChartObjectsSelectionChangedEventArgs"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartObjectsSelectionChangedEventArgs/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# ChartObjectsSelectionChangedEventArgs (class)

Provides data for the chart objects selecting or deselecting event.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Never raised in the CLI: the events that pass it never fire there (ChartArea.ObjectsSelectionChanged).
- Cloud: Never raised in the cloud: the events that pass it never fire there (ChartArea.ObjectsSelectionChanged).

## Definition

```csharp
public class ChartObjectsSelectionChangedEventArgs
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This example shows how to use the Chart ChartObjectsSelectionChangedEventArgs
    // Draw an object, select it and unselect it
    public partial class ChartObjectsSelectionChangedEventArgsSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.ObjectsSelectionChanged += Chart_ObjectsSelectionChanged;
        }

        private void Chart_ObjectsSelectionChanged(ChartObjectsSelectionChangedEventArgs obj)
        {
            Print("Added objects #: {0} | Removed Objects #: {1}", obj.ObjectsAddedToSelection.Count, obj.ObjectsRemovedFromSelection.Count);
        }

        public override void Calculate(int index)
        {
        }
    }
}
```

Python:

```python
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        api.Chart.ObjectsSelectionChanged += self.on_chart_objects_selection_changed

    def on_chart_objects_selection_changed(self, args):
        print(f"Added objects #: {args.ObjectsAddedToSelection.Count} | Removed Objects #: {args.ObjectsRemovedFromSelection.Count}")
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}
```

## Properties

- `public ChartArea Area {get;}` — A chart area where event occured [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartObjectsSelectionChangedEventArgs/Area/index.md)
- `public Chart Chart {get;}` — A chart where event occured [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartObjectsSelectionChangedEventArgs/Chart/index.md)
- `public IReadonlyList<ChartObject> ObjectsAddedToSelection {get;}` — A list of objects that were added to selection [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartObjectsSelectionChangedEventArgs/ObjectsAddedToSelection/index.md)
- `public IReadonlyList<ChartObject> ObjectsRemovedFromSelection {get;}` — A list of objects that were removed from selection [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartObjectsSelectionChangedEventArgs/ObjectsRemovedFromSelection/index.md)

