Is it safe to create a Thread from within a cBot?
My problem is that putting my logic within OnTick() is not fast enough always since it depends on the speed of the tick
So I'm thining about putting it in a Thread or some kind of Timer, does cTrader supply a timer mechansim?
note: I'm not going to open or close trades from within the thread
You can do:
protected override void OnStart()
protected override void OnTimer()
If you need more timers you could use the Timer inside System.Windows.Forms, I read that is also single threaded, read the documentation here:https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.timer?view=netframework-4.7.2
The timers inside System.Timers are not single threaded and I think they're not safe.
My bad tho, I tried it and it doesn't work outside forms, the one built in cTrader is enough for most tasks I think.