New .Net Wrapper for C2DS API

I’ve created a .Net Framework Wrapper for C2DS API

Source code can be downloaded from

http://code.google.com/p/collective2netapi/



Any feedback is appreciated,

Grigori

Great project,



Had you have the time to complete the LatestTradingSignal Class



I will get a look into it, and see if I can help



But would definitively try it in my project



You can email me at dhamel@voiceasp.com

Grigori:



I’ll put a more prominent link to this in the C2 Developer page. Thanks, and great work.

Grigori, do you have any additional updates to this wrapper? I’m using it integrated into RE and wanted to make sure there aren’t any newer updates or documentation you may have for this wrapper.

Hi,



I too have been attempting to use the .Net Wrapper.

(Thanks again for sharing the code!!! Much appreciated!!!)



I’ve been trying to call the GetLatestTradingSignals function.

The function connects and returns but the only return NOSUBSCRIPTIONS



It connects using:



"&e=email&p=password&protoversion=8.2&client=TESTCLIENT&h=machinename&build=1.0.0.0"



I get the session back…



"<collective2><status>OK</status><error><code>0</code></error><data><session>6233292431259403079</session><first>firstname</first><last>lastname</last><redirectip>74.220.16.91</redirectip><redirectport>7878</redirectport><pollinterval>7000</pollinterval><servertime>1307714440</servertime><humantime>2011-06-10 10:00:40</humantime></data></collective2>“



Then try to get the subscriptions using:

//?cmd=latestsigs&session=[sessionid]&h=[host]



The response I get is:



”<collective2><status>error</status><error><code>NOSUBSCRIPTIONS</code><url>http://www.collective2.com/cgi-perl/robothedge.mpl?want=needsystems&amp;c=TESTCLIENT&amp;v=8.2</url></error><data></data></collective2>"





Here’s the code being called:



public LatestTradingSignalsResponse GetLatestTradingSignals()

{

var result = new LatestTradingSignalsResponse();

var request = Core.CoreRequest.Create(this.Server, this.Port, “latestsigs”);



request.Params.Add(“session”, SessionID);

request.Params.Add(“h”, Host);



result.RequestTime = DateTime.Now;

var response = request.GetResponse();

result.ResponseTime = DateTime.Now;



result.Parse(response);



return result;

}

This means that you haven’t yet selected any systems for AutoTrading and/or haven’t told the AutoTrade Wizard that you want to direct the signals into the “Test Client” broker (which isn’t really a broker at all, but rather is your custom-written piece of software, which will connect to C2).



Even if they are your own systems, you still must select the system(s) for AutoTrading. Do this:



Go to http://www.collective2.com/setupautotrade



Choose a system to autotrade (perhaps your own)



Under the broker choice, you should see: “AutoTrade Software Development.” Click this and then select "AutoTrade Test Client (Gen 1)."



If you do not see “AutoTrade Software Development” under your brokerage choices, that means your account hasn’t been enabled for C2 AutoTrade Software Development. If that’s the case, send me an email and I’ll take care of it for you.

Thanks for the quick reply Matthew,



Here’s the test system I setup to subscribe to:

http://www.collective2.com/cgi-perl/system62194985



When I setup the auto trading I only see:



These choices allow trading of stocks:

Gen3

OptionsXpress

Gen3

OpenECry

Gen3

MB Trading

Gen1

TradeBullet Compatible (other)

Gen1

TradeBullet (Gen1 MBT)

Gen1

Interactive Brokers

Gen1

Genesis Securities

Other AutoTrading solutions you can choose:

Gen3

RJ OBrien

Gen3

GFT

Gen3

Gain Capital / Forex.com

Gen3

FXSolutions

Gen3

FXCM

Gen3

Dorman Trading

Gen1

Trader68 Compatible (other)

Gen1

PFGBest







I don’t see a selection for Test Development



Could you please enable my account for Test Development for AutoTrading (CATI)?



Thanks,



Chris

I have enabled your account. Give it a try now.

Awesome works!

Thanks!



Another question… At some point I’d like to test out automatically submitting and retrieving messages. I’ll try it first with some nUnit code with some test scripts. But at some point I’d like to test it against C2 (Just to make sure the the message responses are as expected) However my test account is limited to submitting 5 signals… is it possible to change this?



Thanks,



Chris

Hi, Chris -



Glad to hear it works.



Regarding your 5-signal limit: we do request that developers pay a listing fee in order to create a full system on C2, even if this is just for internal testing purposes. Be sure to declare it as a “test system” as soon as you pay, and before you enter any signals. This allows you to reset the system and clear its track record as many times as you like.



Later, you can decide to “undeclare” its test status, and use it as a real system, if you want. (You’ll need to clear the track record when you do, though, so that test transactions aren’t mixed into live system data.)



Matthew