Login Page - Create Account

Support Board


Date/Time: Fri, 18 Oct 2024 08:41:25 +0000



Post From: Is there a way to make the Study wait in ACSIL ?

[2024-06-18 11:16:12]
User907968 - Posts: 821

std::this_thread::sleep_for(std::chrono::milliseconds(500));
Yes, don't do that.
Will pause execution on the main thread, so nothing can happen at all, hence the unresponsive.



Is there any better way to solve this issue?

Yes.

Return from the function and execute the trade on a subsequent call.
You can use persistent datetime variable(s) to control the length of delay.
All you need do then is store some data relevant to your trade so that it is available next time the function is called.

0.5 seconds delay may not be enough either, you need to check with broker/FCM.
For example, one firm I know of has (had) a limit of 35 message per second and 250 per 10 seconds.
Date Time Of Last Edit: 2024-06-18 11:16:34