API to automate your trading
API to automate your trading
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" }'
{ "results": [ "string" ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X GET \ 'https://api4-general.collective2.com/Strategies/GetStrategyDetails?StrategyId=0' \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "results": [ { "strategyId": 0, "strategyName": "string", "isAlive": true, "startDate": "2019-08-24T14:15:22Z", "primarySecurityTypes": "string", "securityTypesEnabled": { … }, "monthlyCost": 0.1, "strategyOwnerId": 0, "strategyOwnerName": "string", "suggestedCapital": 0, "lastModified": "2019-08-24T14:15:22Z", "score": 0, "isTradeOwnSystem": true, "whiteLabelSiteId": 0, "isHidden": true, "hiddenReason": "string", "isPrivate": true, "aum": 0, "auM_NumberOfAccounts": 0, "return": 0.1, "equity": 0.1, "cash": 0.1, "startingCash": 0.1, "profitFactor": 0.1, "cashDividends": 0.1, "buyingPower": 0.1, "marginUsed": 0.1, "ageInDays": 0, "modelAccountValue": 0.1, "numTrades": 0, "winTrades": 0.1, "winMonths": 0.1, "maxDrawdown": 0.1, "avgWinDollars": 0.1, "avgLossDollars": 0.1, "correlationSP500": 0.1, "alpha": 0.1, "beta": 0.1, "treynor": 0.1, "avgLeverage": 0.1, "maxLeverage": 0.1 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
(optional) SecurityType filter. e.g. Stocks = 'CS', Futures = 'FUT', Options = 'OPT', Forex = 'FOR'
(optional) Filter used to search old stategies. The date must be in ISO 8601 Date Format.
Search strategies on name (optional). Partial matches will be returned. Wildcards % and _ are supported
Result size limit. We will enforce a max size limit for all endpoints. Default is 1000
curl -i -X GET \ https://api4-general.collective2.com/Strategies/SearchStrategies \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "results": [ { "id": 0, "strategyId": 0, "isAlive": true, "isHidden": true, "hiddenReason": "string", "isPrivate": true, "strategyName": "string", "startDate": "2019-08-24T14:15:22Z", "securityTypesEnabled": { … }, "monthlyCost": 0.1, "strategyOwnerId": 0, "whiteLabelSiteId": 0 } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X GET \ https://api4-general.collective2.com/Strategies/GetLeaderBoard \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "results": [ { "id": 0, "strategyId": 0, "isAlive": true, "isHidden": true, "hiddenReason": "string", "isPrivate": true, "strategyName": "string", "startDate": "2019-08-24T14:15:22Z", "securityTypesEnabled": { … }, "monthlyCost": 0.1, "strategyOwnerId": 0, "whiteLabelSiteId": 0 } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X GET \ 'https://api4-general.collective2.com/Strategies/GetSubscribers?StrategyId=0' \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "results": [ { "id": 0, "strategyId": 0, "strategyName": "string", "personId": 0, "subscriptionId": 0, "subscriberId": 0, "isStrategyOwner": true, "alias": "string", "firstName": "string", "lastName": "string", "email": "string", "startDate": "2019-08-24T14:15:22Z", "endDate": "2019-08-24T14:15:22Z", "basePrice": 0.1, "markup": 0.1, "cost": 0.1, "lastTransactionDate": "2019-08-24T14:15:22Z", "lastTransactionAmount": 0.1, "isResale": 0.1, "whiteLabelSiteId": 0, "geoSiteId": "string" } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X GET \ https://api4-general.collective2.com/Strategies/GetSubscriptionRevenue \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "results": [ { "id": 0, "strategyId": 0, "strategyName": "string", "personId": 0, "subscriptionId": 0, "subscriberId": 0, "isStrategyOwner": true, "alias": "string", "firstName": "string", "lastName": "string", "email": "string", "startDate": "2019-08-24T14:15:22Z", "endDate": "2019-08-24T14:15:22Z", "basePrice": 0.1, "markup": 0.1, "cost": 0.1, "lastTransactionDate": "2019-08-24T14:15:22Z", "lastTransactionAmount": 0.1, "isResale": 0.1, "whiteLabelSiteId": 0, "geoSiteId": "string" } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X POST \ https://api4-general.collective2.com/Strategies/NewStrategyOrder \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \ -H 'Content-Type: application/json' \ -d '{ "Order": {} }'
{ "results": [ { "signalId": 0, "profitTargetSignalId": 0, "stopLossSignalId": 0, "exitSignalsOCAGroupId": 0 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X DELETE \ 'https://api4-general.collective2.com/Strategies/CancelStrategyOrder?SignalId=0&StrategyId=0' \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "results": [ { "signalId": 0, "profitTargetSignalId": 0, "stopLossSignalId": 0, "exitSignalsOCAGroupId": 0 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X PUT \ https://api4-general.collective2.com/Strategies/ReplaceStrategyOrder \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \ -H 'Content-Type: application/json' \ -d '{ "Order": {} }'
{ "results": [ { "signalId": 0, "profitTargetSignalId": 0, "stopLossSignalId": 0, "exitSignalsOCAGroupId": 0 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X GET \ 'https://api4-general.collective2.com/Strategies/GetStrategyActiveOrders?StrategyIds=0' \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "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": [ { … } ] } }
curl -i -X GET \ 'https://api4-general.collective2.com/Strategies/GetStrategyOpenPositions?StrategyIds=0' \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "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": [ { … } ] } }
curl -i -X GET \ https://api4-general.collective2.com/Strategies/GetStrategyHistoricalOrders \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "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": [ { … } ] } }
curl -i -X POST \ https://api4-general.collective2.com/Strategies/AddStrategy \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \ -H 'Content-Type: application/json' \ -d '{ "StrategyName": "string" }'
{ "results": [ { "strategyId": 0 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X PUT \ https://api4-general.collective2.com/Strategies/UpdateStrategy \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \ -H 'Content-Type: application/json' \ -d '{ "StrategyId": 0 }'
{ "results": [ { "strategyId": 0 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X GET \ 'https://api4-general.collective2.com/Strategies/GetStrategyHistoricalEquity?StrategyId=0' \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "results": [ { "strategyId": 0, "strategyName": "string", "startDate": "2019-08-24T14:15:22Z", "securityTypesEnabled": { … }, "monthlyCost": 0.1, "strategyOwnerId": 0, "dailyEquity": [ … ], "monthlyResults": [ … ] } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X POST \ https://api4-general.collective2.com/Strategies/SetDesiredPositions \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \ -H 'Content-Type: application/json' \ -d '{ "StrategyId": 0, "Positions": [ {} ] }'
{ "results": [ { "newSignals": [ … ], "canceledSignals": [ … ] } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
The date to look for. The server will automatically adjust the date to the nearest previous available day. Format must be YYYYMMDD.
curl -i -X POST \ https://api4-general.collective2.com/Strategies/SearchHistoricalStrategies \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \ -H 'Content-Type: application/json' \ -d '{ "ReportDate": 0 }'
{ "results": [ { "id": 0, "strategyId": 0, "reportDate": 0, "statistics": [ … ] } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X GET \ 'https://api4-general.collective2.com/Strategies/GetHistoricalStrategiesStatsList?ReportDate=0' \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "results": [ "string" ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X GET \ 'https://api4-general.collective2.com/Strategies/GetWatchLists?PersonId=0' \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "results": [ { "id": 0, "personId": 0, "createdDate": "2019-08-24T14:15:22Z", "listName": "string" } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X GET \ 'https://api4-general.collective2.com/Strategies/GetWatchListMembers?PersonId=0&WatchListId=0' \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "results": [ { "id": 0, "addedDate": "2019-08-24T14:15:22Z", "strategyId": 0, "personId": 0 } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
The Type of list to modify. Valid values are 'LIST' (for the whole watchlist), 'MEMBER' (for the list items)
The change to make. Valid values are: ADD, DELETE
The WatchList Id. Required except when ModificationAction=ADD and ModificationSource=LIST
curl -i -X POST \ https://api4-general.collective2.com/Strategies/ManageWatchList \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \ -H 'Content-Type: application/json' \ -d '{ "PersonId": 0, "ModificationSource": "LIST", "ModificationAction": "ADD" }'
{ "results": [ true ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }
curl -i -X DELETE \ 'https://api4-general.collective2.com/Strategies/ManageWatchList?ModificationAction=string&ModificationSource=string&PersonId=0' \ -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'
{ "results": [ true ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }