Ctrader Close All Async

Created at 27 Jun 2018, 21:31
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!
dleeeq8's avatar

dleeeq8

Joined 03.08.2017

Ctrader Close All Async
27 Jun 2018, 21:31


we need this button.. because Ctrader is Lag when close 10+ positions


@dleeeq8
Replies

ClickAlgo
04 Jul 2018, 17:51

Hi,

This will send requests to your broker to close all open positions asynchronously, if you need more information, drop me an email below.

You can download a trial version to see if it works for you.

https://clickalgo.com/ctrader-advanced-scalping-forex

Paul Hayes
Sales & Marketing
Emailcontact@clickalgo.com
Phone: (44) 203 289 6573
Websitehttps://clickalgo.com

 


@ClickAlgo

solark
04 Jul 2018, 20:28

RE:

Untested but try

            var ps = Positions.FindAll("MyLabel", Symbol, tradeType);
            var count = ps.Length;
            var results = ps.Select(p => ClosePositionAsync(p, callback: x => System.Threading.Interlocked.Decrement(ref count))).ToArray();

`Interlocked.Decrement` returns the value after the decrement. So if you need a final callback when all operations have a result just check for when `Interlocked.Decrement` returns zero and call your final callback. You would do the check within the ClosePositionAsync callback but the check would pass exactly once.


@solark

solark
04 Jul 2018, 20:32

Sorry just noticed you asked for a button. Was thinking you were looking for something else.


@solark