Weird error when optimising
Created at 11 Mar 2023, 16:47
JA
Weird error when optimising
11 Mar 2023, 16:47
Hi,
Has anyone come across this error when running a bot in the optimisation process?
02/01/2020 06:00:15.067 | Unable to invoke target method in current thread. Use `BeginInvokeOnMainThread` method to prevent this error.
I only seem to get this error when trying to run the bot in the optimsation process. I have wrapped everything in a try catch and do not seem to be capturing any errors, which is confusing?
Cheers,
Jay
PanagiotisChar
13 Mar 2023, 15:33
Hi Jay,
This is a common C# exception that occurs when you are trying to access methods from different threads. During optimization, cTrader runs the cBot's dll in a separate thread, therefore this happens. The error also describes the solution to this issue.
Aieden Technologies
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar