CloseAll Fast
CloseAll Fast
20 Jul 2017, 20:48
is there a way to simulate the CoseALL button in cAlgo
as looping trough positions does take way too long .. a algo needs 2 sec or more to close 5 sec. where the close all button just close all of them in almost realtime
Replies
swingfish
21 Jul 2017, 02:15
hello there and thank you
that did the job,
the aim is to get rid of the orders as fast as possible to maintain the target price .. waiting for sync does have advantages, but in this case its better to get the commands out fast ..
Async did the job, sure i still have the lag but all orders are sent already and the server has to deal with it .. thats a huge advantage.
thanks again
@swingfish
BeardPower
20 Jul 2017, 22:04
Use the async methods
Hi,
The "close all" is just an asynchronously call.
You need to use the async functions. These functions do not wait until the position is actually closed. They just send a message to the server to close the position.
The "close all" button does not close them in real-time. It just sends the messages in near real-time. The positions itself can still take 5 seconds to close.
/api/reference/robot/closepositionasync
@BeardPower