Ctrader Close All Async
Created at 27 Jun 2018, 21:31
Ctrader Close All Async
27 Jun 2018, 21:31
we need this button.. because Ctrader is Lag when close 10+ positions
Replies
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
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
Email: contact@clickalgo.com
Phone: (44) 203 289 6573
Website: https://clickalgo.com
@ClickAlgo