Create Trading Account (Deprecated)
API URL: POST https://userapi-demo.s2f.projectx.com/TradingAccount/Create
API Reference: /TradingAccount/Create
Description
Creates a new Trading Account. If empty, the startingBalance, drawdownLimit, dailyLossLimit, maximumPositionSize, and maxMargin parameters default to the Account Template parameters associated with the account.
Parameters
| Name | Type | Description | Required | Nullable |
|---|---|---|---|---|
| userId | integer | The userId associated with the new Trading Account. | true | true |
| combineId | integer | The ID of the Account Template associated with the new Trading Account. | true | true |
| accountName | string | The new Trading Account's account name. | true | true |
| type | integer | The new Trading Account's account type. | true | true |
| internalTag | integer | The new Trading Account's internal tag. | true | true |
| startingBalance | decimal | The new Trading Account's starting balance | false | true |
| drawDownLimit | decimal | The new Trading Account's drawdown limit. | false | true |
| dailyLossLimit | decimal | The new Trading Account's daily loss limit. | false | true |
| maximumPositionSize | integer | The new Trading Account's maximum position size. | false | true |
| maximumMargin | decimal | The new Trading Account's maximum margin. | false | true |
| useMargin | boolean | A boolean that will determine whether the new Trading Account will use maximumPositionSize or maximumMargin to calculate the true maximum position size of the account. | false | true |
Example Usage
Example Request
- Request
- cURL
This request will create a new trading account for a user with an ID 7, a template ID of 2, an account name of "EVALAPR1424", and an account type of "SIM."
{
"userId": 7,
"combineId": 2,
"accountName": "EVALAPR1424",
"type": 1,
"internalTag": 0,
"startingBalance": 0,
"drawDownLimit": 0,
"dailyLossLimit": 0,
"maximumPositionSize": 0,
"maximumMargin": 0,
"useMargin": true
}
This request will create a new trading account for a user with an ID 7, a template ID of 2, an account name of "EVALAPR1424", and an account type of "SIM."
curl -X 'POST' \
'https://userapi-demo.s2f.projectx.com/TradingAccount/create' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"userId": 7,
"combineId": 2,
"accountName": "EVALAPR1424",
"type": 1,
"internalTag": 0,
"startingBalance": 0,
"drawDownLimit": 0,
"dailyLossLimit": 0,
"maximumPositionSize": 0,
"maximumMargin": 0,
"useMargin": true
}'
Example Response
- Success
- Error
{
"tradingAccount": {
"realizedDayPnl": 0,
"updatedAt": "2024-04-15T02:35:35.074994+00:00",
"personalDailyLossLimit": null,
"personalDailyLossLimitAction": 0,
"personalDailyProfitTarget": null,
"personalDailyProfitTargetAction": 0,
"totalProfit": 0,
"totalLoss": 0,
"totalTrades": 0,
"dailyTrades": 0,
"isFollower": false,
"isLeader": false,
"openPnl": 0,
"accountName": "EVALAPR1424",
"userId": 7,
"startingBalance": 50000.0000,
"balance": 50000.0000,
"status": 0,
"marketDataLevel": 0,
"accountId": 1947,
"winRate": 0,
"profitAndLoss": 0,
"startDate": "2024-04-15T02:35:35.074994+00:00",
"closedDate": null,
"dailyLoss": 1000.0000,
"maximumLoss": 48000.0000,
"drawDownLimit": 2000.0000,
"maxPositions": 5,
"type": 1,
"startOfDayBalance": 50000.0000,
"combineName": "50K TEMPLATE",
"platformId": 0,
"platformAccountId": null,
"maxMargin": null
},
"result": 0,
"errorMessage": null
}
Error: response status is 401