Collective2 General API (v4)

API to automate your trading

Download OpenAPI description
Languages
Servers
https://api4-general.collective2.com/

Schemas

Autotrade

Operations

GetAutotradedStrategies

Request

Request the Autotraded strategies of the person. Paginated endpoint.

Query
PersonIdinteger or null(int64)required

PersonId

Accountstring or null

The Autotrade account (optional)

Cursorstring or null

The Cursor from the previous resultset

Limitinteger(int32)

Result size limit. We will enforce a max size limit for all endpoints. Default is 1000

AscendingOrderboolean

Set to FALSE if you want to get the newest results first. Default is TRUE (oldest results first)

curl -i -X GET \
  'https://api4-general.collective2.com/Autotrade/GetAutotradedStrategies?PersonId=0' \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(AutotradedStrategyDTO)
paginationobject(PaginationProperties)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "id": 0, "personId": 0, "account": "string", "scalingPercentage": 0.1, "strategyId": 0, "strategyName": "string", "brokerId": 0, "brokerName": "string", "startDate": "2019-08-24T14:15:22Z", "lastModified": "2019-08-24T14:15:22Z" } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

GetAutotraders

Request

A list of Autotraders. Paginated endpoint.

Query
StrategyIdinteger or null(int64)

(Optional) StrategyId filter

BrokerIdinteger or null(int32)

(optional) The Autotrade BrokerId

WhiteLabelSiteIdinteger or null(int64)

(optional) The White Label Site Id

Cursorstring or null

The Cursor from the previous resultset

Limitinteger(int32)

Result size limit. We will enforce a max size limit for all endpoints. Default is 1000

AscendingOrderboolean

Set to FALSE if you want to get the newest results first. Default is TRUE (oldest results first)

curl -i -X GET \
  https://api4-general.collective2.com/Autotrade/GetAutotraders \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(AutotradedStrategyDTO)
paginationobject(PaginationProperties)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "id": 0, "personId": 0, "account": "string", "scalingPercentage": 0.1, "strategyId": 0, "strategyName": "string", "brokerId": 0, "brokerName": "string", "startDate": "2019-08-24T14:15:22Z", "lastModified": "2019-08-24T14:15:22Z" } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

GetAutotradeSettings

Request

The Autotrade Settings. Non-paginated endpoint.

Query
PersonIdinteger or null(int64)required

PersonId

Accountstring or null

(Optional) Account

curl -i -X GET \
  'https://api4-general.collective2.com/Autotrade/GetAutotradeSettings?PersonId=0' \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(AutotradeSettingsDTO)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "id": 0, "personId": 0, "firstName": "string", "lastName": "string", "email": "string", "country": "string", "state": "string", "language": "string", "siteDomain": "string", "brokerId": 0, "connection": "string", "introducingBrokerId": 0, "introducingBroker": "string", "strategyId": 0, "strategyName": "string", "account": "string", "accountType": 0, "brokerUserID": "string", "currency": "string", "salesRepId": 0, "salesRep": "string", "isTradeLeader": true, "isManualDiscardedPosition": true, "isConfirmationNeeded": true, "isSyncEnabled": true, "isBrokerEnabled": true, "isAutotradeDisabled": true, "isAutotradeDisabledReason": "string", "syncDisabledReason": "string", "firstBrokerActivationDate": "2019-08-24T14:15:22Z", "netLiquidationValue": 0.1, "netLiquidationValueDate": "2019-08-24T14:15:22Z", "virtualLimitOrdersEnabled": true, "scalingPercentage": 0.1, "settingsLastUpdateUTC": "2019-08-24T14:15:22Z", "enabledFutures": true, "futuresLong": true, "futuresShort": true, "minFutures": 0, "maxFutures": 0, "enabledForex": true, "forexEnabledLong": true, "forexEnabledShort": true, "forexLotSize": 0, "minForex": 0, "maxForex": 0, "enabledStocks": true, "stocksLong": true, "stocksShort": true, "maxStocksDollars": 0, "tradeStocksAsCFD": true, "enabledOptions": true, "optionsLong": true, "optionsShort": true, "minOptions": 0, "maxOptions": 0 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

GetDashBoard

Request

Request the Person's Autotraded strategies and a performance summary. Non-paginated endpoint.

Query
PersonIdinteger or null(int64)required

PersonId

Accountstring or nullrequired

The brokerage Account

curl -i -X GET \
  'https://api4-general.collective2.com/Autotrade/GetDashBoard?Account=string&PersonId=0' \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(DashBoardItemDTO)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "personId": 0, "brokerName": "string", "account": "string", "strategyId": 0, "strategyName": "string", "startDate": "2019-08-24T14:15:22Z", "todayReturn": 0.1, "totalReturn": 0.1 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

SearchAccounts

Request

Request a list of Autotrade and Papertrade accounts. Partial matches will be returned. Paginated endpoint. Only visible to the account owner or White-label site owner

Query
Accountstring or null

The Autotrade account (optional)

PersonIdinteger or null(int64)

PersonId (optional)

BrokerIdinteger or null(int32)

The Autotrade BrokerId (optional)

FirstNamestring or null

The FirstName (optional). Not case-sensitive

LastNamestring or null

The FirstName (optional). Not case-sensitive

Emailstring or null

The Email (optional)

WhiteLabelSiteIdinteger or null(int64)

The White Label site Id (optional)

CountryCodestring or null

The person's country code. Not case-sensitive (optional)

IPAddressstring or null

The person's last known IP address (optional)

Phonestring or null

The Phone number (optional)

Cursorstring or null

The Cursor from the previous resultset

Limitinteger(int32)

Result size limit. We will enforce a max size limit for all endpoints. Default is 1000

AscendingOrderboolean

Set to FALSE if you want to get the newest results first. Default is TRUE (oldest results first)

curl -i -X GET \
  https://api4-general.collective2.com/Autotrade/SearchAccounts \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(AccountDTO)
paginationobject(PaginationProperties)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "id": 0, "personId": 0, "account": "string", "brokerName": "string", "brokerId": 0, "firstName": "string", "lastName": "string", "email": "string", "language": "string", "whiteLabelSiteId": 0, "geoSite": "string", "countryCode": "string", "divisionCode": "string", "authenticatedDate": "2019-08-24T14:15:22Z" } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

GetAutotradeActiveOrders

Request

Request the Working orders of the Account. Non-paginated endpoint.

Query
Accountstring or nullrequired

The Brokerage Account

PersonIdinteger or null(int64)required

The PersonId owning the account

StrategyIdinteger or null(int64)

(Optional) StrategyId filter

curl -i -X GET \
  'https://api4-general.collective2.com/Autotrade/GetAutotradeActiveOrders?Account=string&PersonId=0' \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(OrderStatusDTO)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "id": 0, "orderId": "string", "strategyId": 0, "strategyName": "string", "signalId": 0, "orderType": "1", "side": "1", "openClose": "O", "orderQuantity": 0.1, "limit": 0.1, "stop": 0.1, "tif": "0", "profitTarget": 0.1, "stopLoss": 0.1, "doNotCreateOCAGroup": null, "cancelReplaceSignalId": 0, "parentSignalId": 0, "doNotSyncToOpen": null, "c2Symbol": {}, "exchangeSymbol": {}, "rejectMessage": "string", "brokerId": 0, "orderStatus": "string", "filledQuantity": 0.1, "avgFillPrice": 0.1, "postedDate": "2019-08-24T14:15:22Z", "signalType": 0, "info": "string" } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

GetAutotradeHistoricalOrders

Request

Request the historical orders of the Account. Paginated endpoint.

Query
Accountstring or nullrequired

Brokerage Account filter

PersonIdinteger or null(int64)required

The PersonId owning the account

BrokerIdinteger or null(int32)

BrokerId (Optional)

StrategyIdinteger or null(int64)

StrategyId (Optional)

OrderStatusstring or null

'A' = PendingNew, '0' = Working, '1' = Partially filled, '2' = Filled, '4' = Canceled, '5' = Replaced, '6' = Pending Cancel, '8' = Rejected, 'C' = Expired, 'E' = Pending Replace (Optional)

Enum"A""0""1""2""4""5""6""8""C""E"
StartDatestring or null(date-time)

StartDate (Optional)

EndDatestring or null(date-time)

EndDate (Optional)

Cursorstring or null

The Cursor from the previous resultset

Limitinteger(int32)

Result size limit. We will enforce a max size limit for all endpoints. Default is 1000

AscendingOrderboolean

Set to FALSE if you want to get the newest results first. Default is TRUE (oldest results first)

curl -i -X GET \
  'https://api4-general.collective2.com/Autotrade/GetAutotradeHistoricalOrders?Account=string&PersonId=0' \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(OrderStatusDTO)
paginationobject(PaginationProperties)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "id": 0, "orderId": "string", "strategyId": 0, "strategyName": "string", "signalId": 0, "orderType": "1", "side": "1", "openClose": "O", "orderQuantity": 0.1, "limit": 0.1, "stop": 0.1, "tif": "0", "profitTarget": 0.1, "stopLoss": 0.1, "doNotCreateOCAGroup": null, "cancelReplaceSignalId": 0, "parentSignalId": 0, "doNotSyncToOpen": null, "c2Symbol": {}, "exchangeSymbol": {}, "rejectMessage": "string", "brokerId": 0, "orderStatus": "string", "filledQuantity": 0.1, "avgFillPrice": 0.1, "postedDate": "2019-08-24T14:15:22Z", "signalType": 0, "info": "string" } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

GetAutoTradeOpenPositions

Request

Request the open positions of the Account. Non-paginated endpoint.

Query
Accountstring or nullrequired

Brokerage Account filter

StrategyIdinteger or null(int64)

(Optional) StrategyId filter

curl -i -X GET \
  'https://api4-general.collective2.com/Autotrade/GetAutoTradeOpenPositions?Account=string' \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(PositionDTO)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "quantity": 0.1, "c2Symbol": {}, "exchangeSymbol": {}, "strategyId": 0, "strategyName": "string", "currency": "string", "openedDate": "2019-08-24T14:15:22Z", "avgPx": 0.1 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

NewAutotradeOrder

Request

Send a new closing order to the specified account. Only Stop and Limit OrderTypes are supported. Non-paginated endpoint.

Bodyapplication/json
Accountstring or nullrequired

The Autotrade account

PersonIdinteger or null(int64)required

The C2 PersonID

Orderobject(OrderDTO)required
idinteger(int64)
orderIdstring or null
strategyIdinteger or null(int64)
strategyNamestring or null
signalIdinteger or null(int64)
orderTypestring or null
Enum ValueDescription
1

Market

2

Limit

3

Stop

Example: "1"
sidestring or null
Enum ValueDescription
1

Buy

2

Sell

Example: "1"
openClosestring or null
Enum ValueDescription
O

Open

C

Close

Example: "O"
orderQuantitynumber or null(double)
limitnumber or null(double)
stopnumber or null(double)
tifstring or null
Enum ValueDescription
0

Day

1

GTC

Example: "0"
profitTargetnumber or null(double)
stopLossnumber or null(double)
doNotCreateOCAGroupboolean or null
Default null
cancelReplaceSignalIdinteger or null(int64)
parentSignalIdinteger or null(int64)
doNotSyncToOpenboolean or null
Default null
c2Symbolobject(C2SymbolDTO)
exchangeSymbolobject(ExchangeSymbolDTO)
rejectMessagestring or null
curl -i -X POST \
  https://api4-general.collective2.com/Autotrade/NewAutotradeOrder \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "Account": "string",
    "PersonId": 0,
    "Order": {}
  }'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(SignalIdDTO)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "signalId": 0, "profitTargetSignalId": 0, "stopLossSignalId": 0, "exitSignalsOCAGroupId": 0 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

CancelAutotradeOrder

Request

Cancel an order in the specified account. Auto Stop-Loss orders are not currently supported. Non-paginated endpoint.

Query
Accountstring or nullrequired

The Autotrade account

PersonIdinteger or null(int64)required

The C2 PersonID

OrderIdstring or nullrequired

The OrderID to be cancelled

curl -i -X DELETE \
  'https://api4-general.collective2.com/Autotrade/CancelAutotradeOrder?Account=string&OrderId=string&PersonId=0' \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(SignalIdDTO)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "signalId": 0, "profitTargetSignalId": 0, "stopLossSignalId": 0, "exitSignalsOCAGroupId": 0 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

ReplaceAutotradeOrder

Request

Cancel/Replace an open closing order in the specified account. Only strategy and manual exit orders are currently supported.

Bodyapplication/json
Accountstring or nullrequired

The Autotrade account

PersonIdinteger or null(int64)required

The C2 PersonID

OrderIdstring or nullrequired

The OrderID to be replaced

Pricenumber or null(double)required

The new Order price

curl -i -X PUT \
  https://api4-general.collective2.com/Autotrade/ReplaceAutotradeOrder \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "Account": "string",
    "PersonId": 0,
    "OrderId": "string",
    "Price": 0.1
  }'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(SignalIdDTO)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "signalId": 0, "profitTargetSignalId": 0, "stopLossSignalId": 0, "exitSignalsOCAGroupId": 0 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

GetBrokers

Request

Get a list of Autotrade brokers. Non-Paginated endpoint.

Query
IncludeDisabledboolean or null

Include the disabled brokers. Default is FALSE. (optional)

curl -i -X GET \
  https://api4-general.collective2.com/Autotrade/GetBrokers \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(BrokerDTO)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "id": 0, "name": "string", "isEnabled": true, "connectionName": "string" } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

StartAutotrade

Request

Start or modify an Autotrade setup. Non-paginated endpoint.

Bodyapplication/json
Accountstring or nullrequired

The Autotrade account

PersonIdinteger or null(int64)required

The C2 PersonID

BrokerIdinteger or null(int32)required

The BrokerId

StrategyIdinteger or null(int64)required

The StrategyId

ScalingPercentageinteger(int64)required

The Autotrade Scaling factor. e.g. Enter 105 for 105%

FuturesEnabledboolean

(optional) TRUE to enable the Futures asset class when autotrading this strategy. Default is FALSE

MaxFuturesinteger or null(int32)

(optional) Set a maximum number of contracts to hold in a position for this strategy

ForexEnabledboolean

(optional) TRUE to enable autotrading Forex for this strategy. Default is FALSE

MaxForexinteger or null(int32)

(optional) Set a maximum number of units (each unit on C2 is 10000 currency units) to hold in a position for this strategy

StocksEnabledboolean

(optional) TRUE to enable autotrading Stocks for this strategy. Default is FALSE

MaxStocksDollarsinteger or null(int32)

(optional) Set a maximum number of dollars to hold in a position for this strategy (no decimals)

OptionsEnabledboolean

(optional) TRUE to enable autotrading Options for this strategy. Default is FALSE

ShortOptionsEnabledboolean

(optional) TRUE to enable the shorting of Options when autotrading this strategy. Default is FALSE

MaxOptionsinteger or null(int32)

(optional) Set a maximum number of contracts to hold in a position for this strategy

DoNotJoinCurrentSystemPositionsboolean or null

(optional) TRUE to prevent joining currently open positions in the strategy. Only applies to new Autotrade setups: this setting must not be set when modifing an existing Autotrade setup.

AutoStopLossinteger or null(int64)

(optional) Dollar value of the automated stop loss which will rest in addition to the strategy stop loss orders

AccountUserNamestring or null

(optional) The Brokerage account username. Only needed for specific Brokers, please enquire with support at help@collective2.com

AccountPasswordstring or null

(optional) The Brokerage account password. Only needed for specific Brokers, please enquire with support at help@collective2.com

curl -i -X POST \
  https://api4-general.collective2.com/Autotrade/StartAutotrade \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "Account": "string",
    "PersonId": 0,
    "BrokerId": 0,
    "StrategyId": 0,
    "ScalingPercentage": 0
  }'

Responses

OK

Bodyapplication/json
boolean
Response
application/json
true

StopAutotrade

Request

Stop a autotrade setup. Non-paginated endpoint.

Query
Accountstring or nullrequired

The Autotrade account

PersonIdinteger or null(int64)required

The C2 PersonID

StrategyIdinteger or null(int64)required

The StrategyId

BrokerIdinteger or null(int32)

The BrokerId

LeavePositionsOpenboolean

TRUE to leave positions open in the autotraded account. Default is FALSE

TerminateStrategySubscriptionboolean

TRUE to stop the Strategy subscription. Default is FALSE

curl -i -X DELETE \
  'https://api4-general.collective2.com/Autotrade/StopAutotrade?Account=string&PersonId=0&StrategyId=0' \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
boolean
Response
application/json
true

GetSimResults

Request

Return SIM trading results for all subscribers who are using “free sims.”. Only people who signed up at the site within the past 90 days are included. Non-Paginated endpoint.

Query
PersonIdinteger or null(int64)

PersonId (optional)

WhiteLabelSiteIdinteger or null(int64)

The WhiteLabel SiteId (optional)

ActiveOnlyboolean

Set to FALSE to get the full history of all Simulation results (optional). Default is TRUE

curl -i -X GET \
  https://api4-general.collective2.com/Autotrade/GetSimResults \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(SimResultDTO)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "personId": 0, "firstName": "string", "lastName": "string", "email": "string", "account": "string", "strategyId": 0, "strategyName": "string", "startDate": "2019-08-24T14:15:22Z", "endDate": "2019-08-24T14:15:22Z", "startEquity": 0, "endEquity": 0, "totalReturn": 0.1, "totalDelta": 0.1, "scalingFactor": 0 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

Hello

Request

Test endpoint that can be used to test your API Key, RateLimits, Headers, etc

Bodyapplication/json
Namestring or nullrequired

Your name (or any string)

curl -i -X POST \
  https://api4-general.collective2.com/General/Hello \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "Name": "string"
  }'

Responses

OK

Bodyapplication/json
resultsArray of strings or null
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ "string" ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ {} ] } }

General

Operations

Strategies

Operations