Any possible to programming select a group of objects?

Created at 02 Jul 2023, 02:49
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
Capt.Z-Fort.Builder's avatar

Capt.Z-Fort.Builder

Joined 03.06.2020

Any possible to programming select a group of objects?
02 Jul 2023, 02:49


Hello,

I wonder if there is any way we can do:  Object.Select()

I have many objects, Icons, Trendlines, Rectangles etc, which are created by algo. I need to move a group of them, with specific strings in their names.  Is there any method I can quickly (programmable) selected them, some code like below?  I didn't find a proper method. Please advise.

Thanks.
 

var Icons = Chart.FindAllObjects(ChartObjectType.Icon).Where(x => (x.Name).Contains("USD"));
foreach ( ChartIcon Icon in Icons) { Icon.Select(); }

 


@Capt.Z-Fort.Builder
Replies

Capt.Z-Fort.Builder
02 Jul 2023, 03:00 ( Updated at: 21 Dec 2023, 09:23 )

OK, I find an alternative way:

Ctrl + D to open the object manager, key in the keyword of the object's name, then Ctrl + A to select the relevant objects only.

P.S. However, the keywords 'USD' and 'JPY' don't work in the search bar, if the chart is in 'USDJPY'.  All other currencies' names work well. It's bizarre...


@Capt.Z-Fort.Builder