Coding MOC Orders

Hi all,

Just wondering if somebody had handy some sample code for issuing a MOC order signal to C2. The document that I have seen seem to indicate the usage of the “park until” parameter, but the API documentation does not indicate the format of the park until parameter. The system that I have in mind is a day trade system whcih will issue a BTO using a limit order and then as soon as that is executed, to then fire off the STC MOC order. The timing on the STC MOC order is what I am unsure of. Is it possible to just specify a 13.59pm US EST without any reference to the date and/or other timezone related parameters

TIA

Bing

OK, I have made some progress with this. I tried to submit the following conditional order

curl -k -d ‘{
“apikey”: " xxxxxxxxxxxxxxxxxxxxxxxx",
“systemid”: “yyyyyyyyyyy”,
“signal”:{
“action”: “STC”,
“quant”: 100,
“symbol”: “DIA”,
“typeofsymbol”: “stock”,
“parkUntil”: “201606031559”,
“duration”: “DAY”,
“conditionalUponSignal”: { “action”: “BTO”, “quant”: 100, “symbol”: “DIA”,“typeofsymbol”: “stock”, “limit”: 175.50, “duration”: “DAY” }
}
}’ -H “Content-Type: application/json” ‘https://collective2.com/world/apiv3/submitSignal

and got the error code of “Unable to access this systemid - Credentials provided do not allow access to this systemid”. I know that the systemid and apikeys are correctly set because I have managed to transmit other signals.

Bing -

Can you send the specifics to help@collective2.com, including the system id? I’ll try to replicate and fix the problem. (First I want to study the server audit log, but need your system ID to do so).

By the way, the parameter you want to use is:

“parkUntilYYYYMMDDHHMM” (no quotes, times are Eastern USA)

alternately you can use

“parkUntilSecs” (which requires the Unix “epoch” time)