Increase speed of closing positions by bot

Created at 26 Apr 2024, 21:40
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!
CH

ChrisSpire

Joined 12.12.2022

Increase speed of closing positions by bot
26 Apr 2024, 21:40


Dear Guys,

When using:

foreach (var pos in Positions) ClosePosition(pos);

the positions are closed visibly slower than when using built-in Close button in Positions tab (lower right part of the interface). When I have 4-5 position, closing them with cBot takes 2-3x more time than using built-in button.

Is there a way to increase the speed? I am not familiar with async functions, maybe I should look there?

Thanks, Chris


@ChrisSpire
Replies

PanagiotisCharalampous
27 Apr 2024, 08:09

Hi there,

Use ClosePositionAsync() instead

Best regards,

Panagiotis


@PanagiotisCharalampous