Skip to main content

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


NameTypeDescriptionRequiredNullable
userIdintegerThe userId associated with the new Trading Account.truetrue
combineIdintegerThe ID of the Account Template associated with the new Trading Account.truetrue
accountNamestringThe new Trading Account's account name.truetrue
typeintegerThe new Trading Account's account type.truetrue
internalTagintegerThe new Trading Account's internal tag.truetrue
startingBalancedecimalThe new Trading Account's starting balancefalsetrue
drawDownLimitdecimalThe new Trading Account's drawdown limit.falsetrue
dailyLossLimitdecimalThe new Trading Account's daily loss limit.falsetrue
maximumPositionSizeintegerThe new Trading Account's maximum position size.falsetrue
maximumMargindecimalThe new Trading Account's maximum margin.falsetrue
useMarginbooleanA boolean that will determine whether the new Trading Account will use maximumPositionSize or maximumMargin to calculate the true maximum position size of the account.falsetrue

Example Usage


Example Request

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
}

Example Response

{
"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
}