Testing the C2ATI

I read through the C2ATI document and am now ready to start some experimentation with the AutoTrading API. I have obtained a client name, but I need to 1) create a dummy trading system to generate test signals, and 2) give that system permission to autotrade using my client. Is this possible? If not, please let me know the method we are supposed to use to test out our client apps.



Thanks much.



Gary

I have recently added a few features to help software developers who want to create C2-compatible autotrading software/services.



(1) Make sure you have requested “Developer Permissions” from me. If you can access the C2ATI documentation posted here (see yellow box called ‘Other C2 Developer Resources,’ in this forum) then you have permission. If you don’t yet have permission, just send me an email telling me that you need it. (matthew at collective2.com) It’s helpful (but not required) to give me a sense of the project you are working on, so that I can steer you in the right direction.



(2) Once you have Developer Permissions, you will be able to test software more easily. Specifically, if you go to the AutoTrading Permissions page on C2, a new item will appear in the drop-down menu under “Orders get sent to.” You will see: “C2 Test Client.” In order to test your software, select that item from the menu.



(3) When testing your AutoTrading software, you need to login to the AutoTrade server using the special client name called: “TESTCLIENT” (no quotes, yes all caps). (You specify the client name in your login string.) If you have set your trading permission page to send orders to C2 Test Client, and then your software logs in to the autotrade server using client=TESTCLIENT in the login string, you will be sent all orders as specified in the trading permissions page. Please note then, when you are ready to release a “production version” of your software, you will need to use your real-life official “client name” (not TESTCLIENT) and I will need to add your software to the drop-down menu that people see on the Trading Permissions page.



(4) Authorized C2 developers can create a free test system. Just create a system on C2, then go to the EDIT link, then specify that you want it to be a test system. Keep in mind most of the normal restrictions apply: once you designate it a test system, you cannot change your mind later.



Matthew

Hi Matthew,



Thanks for the info – that’s exactly what I needed. However, I’m still having a problem getting the signals from my test system. After selecting my test system under “Add a new AutoTrade trading permission” I selected the “C2 Test Client”. However, after clicking the Add button my current AutoTrade permissions show the “Order Dest” as blank. When I pull down the menu I get the three available commercial products plus blank as my four options. I have a feeling this is the reason I am not getting signals when I make the request to the API. Can you look to see if this is the problem?



Thanks again.



Gary

OK. Now the C2 Test Client should appear. Try one more time and see if that solves the problem.

Hi Matthew,



That seemed to fix the interface, but it did not fix my problem. Let me just give you a quick summary of my test case in case I’m doing something wrong:



1) Created a new system (#21326143) and gave it Long and Short permission to autotrade all Stock symbols using the C2 Test Client

2) Made of couple of trades of the QQQQ

3) Opened a web browser and used this command to get a sessionid:



http://64.68.145.3:7878/?cmd=login&e=glynn@nd.com&p=xxx&protoversion=8&client=TESTCLIENT&h=garyinspiron&build=1



where “xxx” is my actual password.



4) Entered this URL into the browser:



http://64.68.145.3:7878/?cmd=latestsigs&session=21432129104823765669&h=garyinspiron



The resulting xml code was:



<collective2>

<status>OK</status>

<error>

<code>0</code>

</error>

<data>

<recentc2fills>

</recentc2fills>





<cancelsiglist>

</cancelsiglist>





<fillinforeceived>

</fillinforeceived>







<pollinterval>7000</pollinterval>

<servertime>1149528245</servertime>

<humantime>2006-06-05 13:24:05</humantime>



</data>

</collective2>



Did I miss a step?



Thanks.



Gary

You’re doing everything right. The problem is that you polled for new signals at 13:24 Eastern, but the signals you entered into your system were entered at 13:15.



Keep in mind that the signals you entered into the test system were market orders which had been filled over 10 minutes before you polled. The server will not send “stale” market orders. (The idea behind the AutoTrade server protocol is that most of the “hard” logic should reside on the server side so that your clients can simply ask: “Do I need to execute anything?” and can act “dumb” and follow whatever instructions the server sends. The server didn’t want you to place an OPENING market order that was over ten minutes old.)



To test your software, use limit/stop orders placed outside the market range. Then you should see the signals when you poll.



Matthew

Hi Matthew,



That makes sense. I just tried to test it out with a limit order, but I got a message that my complimentary listing has expired. I had checked the box designating it as a test system. Is there anything else I need to do to keep my free test system active?



Gary

Hi Matthew,



I was able to enter that Limit order (Buy QQQQ at 38) and it is shown as pending. However, the API is still not including any signal packets within the XML code. Any other ideas?



Thanks.



Gary

The market is closed, so it won’t send you the order until a few minutes before the market opens.



To test, use a 24-hour instrument like the @ESM6 future, or EURUSD (forex).



MK

Hi Matthew,



Sorry to be a pain, but that didn’t work either. I’ve got a BTO Limit order pending for the EUR/USD at 1.28. No sign of it within the XML. I also made sure I assiged Forex permission to the system for all symbols.



As an aside, I noticed that the “Order Dest” menu is only shown for the first entry in my permissions list (the one for Forex) and not the second one (the one for Stocks). I am assuming this means that my “C2 Test Client” selection applies to both line items, but perhaps it is a bug.



Gary

You’re a saint to work through this. I’ve found the source of the problem – it had to do with the way TESTCLIENT was being used by the AutoTrade server. I have tested by creating a fake signal in your test system, and I believe the problem is now fixed. Thanks for your patience.

Hi Matthew,



I appreciate your quick responses. I think we are making progress. I cancelled the 3 open trades in the system and re-issued a new trade for the EUR/USD. The good news is that the IDs for the 3 cancels were listed. The bad news is that there is still no sign of the pending limit order.



Gary