Background: I am connecting an automated trading system to C2 using Signal and Data Services API. My system works with large portfolios - 200 instruments is not unusual. During testing I hit a couple of performance related issues:
1. closealltrades command takes very long time execute. This morning closing 90 positions took more than 5 minutes. Is there a workaround?
2. Sending multiple signals in a short time triggers a DOS defense. Are there guidelines on how many signals can be sent and how quick?
2. 504 Gateway Timeouts are very common. Is it normal?[LINKSYSTEM_79851560]
Hi, Alexandr:
Well, you may simply be bumping up against performance limits that are going to be tricky to overcome. Part of the problem may be more business than technical. We have a pretty democratic business model: everyone pays the same to run a system on C2, and all systems earn the same for the company when they are traded. So it’s hard to devote, say, 80% of CPU resources to 20% of systems that earn 5% of revenues.
I hope this isn’t a shocking thing to say. It’s just honest business reality. This isn’t to say there are no answers – there may be – but I need to think about what they are and how to implement them.
In the meantime, let’s try to mitigate some of the issues you have. I can’t make the closealltrades command any faster at this moment, but you can probably see what it’s doing: closing trades sequentially, one by one. You might want to consider using the API to close trades on a concurrent basis. Please be polite if you choose this path, and throttle the requests to a reasonable level – let’s try with 2 concurrent trade signals at once, and see if that makes things okay, and then (perhaps) bump it up to 3.
As for your other two points, we have a throttle on the number of signals that can be sent in a given time period. I believe the default value is 40 signals per two minutes. If you need more than that, send an email to the help desk, and we can bump it up a bit to try to make things work a bit better.
Regarding time-outs, I’m not entirely sure what is causing this, and would need to know the exact circumstances you see them.
Matthew
Mathew,
I appreciate you quick response. I will try to close position manually using concurrent signals.
As I mentioned my trading system can manage large portfolios - several hundred instruments, based on your answers it appears that Collective2 can not handle this amount of work. Am I correct?
In other words, can I open open and close a position in, say, 200 stocks in a timely manner? If so, how? Maybe I can use another protocol? I currently support Fix 4.2.
Kind regards,
Alex. [LINKSYSTEM_79851560]