The Quick Trade tool in Eclipse is used to create single buy or sell trades in an account. It can also be used to import a list of buy and sell trades for multiple accounts.
The tool in the Eclipse API consists of 3 main parts:
- Issuing a request for a single Account, or uploading an import file to trade multiple Accounts.
- Validation
- This step is optional, but can give you some insight about what may or may not be wrong with your proposed trades.
- Trade validation is only applicable to single Account Buy and Sell Quick Trades.
- Creating Orders
Validation (optional)
The validation step is optional, and only applies to Buy and Sell Quick Trades. The validation endpoint supports many trade tools, but for Quick Trades, the request is fairly simple.
Name | Type | Required | Description |
action | number | yes | 1=Buy, 2=Sell |
tradeShares | number | no* | number of shares to trade, fractional shares are allowed depending on custodian configuration |
tradePercent | number | no* | percent of security holdings held, applies to sell trades only |
tradeAmount | number | no* | dollar amount to trade |
accountId | number | yes | id of the account being traded |
portfolioId | number | no | id of the portfolio being traded |
securityId | number | yes | id of the security being traded |
symbol | string | no | ticker of the security being traded |
Quick Trade, Validation
POST api/v2/tradeorder/trades/action/validate
{
"application": "QuickTrades",
"trades": [
{
"action": 1,
"tradeShares": null,
"tradePercent": null,
"tradeAmount": 2100.57,
"accountId": 127,
"portfolioId": 227,
"securityId": 13,
"symbol": "AAPL"
}
]
}
Creating Orders
Order creation is done through V1 and V2 endpoints, depending on what type of Quick Trade you are requesting:
- V1: Account Liquidation
- V2: Account Buy and Sell Quick Trades
Quick Trade, Account Liquidation
Name | Type | Required | Description |
accountId | number | yes | id of the account being traded |
portfolioId | number | no | id of the portfolio being traded |
actionId | number | yes | 6=Liquidate |
tradeToolSelection | number | no** | 2=Acccount |
tradeInstanceType | number | no** | 5=Quick Trade |
tradeInstanceSubType | number | no** | 11=Quick Trade |
isSendImmediately | boolean | no | true=Execute Trades Immediately |
{
"accountId": 127,
"portfolioId": 227,
"actionId": 6,
"tradeToolSelection": 2,
"tradeInstanceType": 5,
"tradeInstanceSubType": 11,
"isSendImmediately": false
}
Quick Trade, Create Order
Name | Type | Required | Description |
application | string | yes | name of the Trade Tool, always “QuickTrades” in this use case |
action | number | yes | 1=Buy, 2=Sell |
isSendImmediately | boolean | no | true=Execute Trades Immediately |
portfolioId | number | yes | id of the portfolio being traded |
accountId | number | yes | id of the account being traded |
tradeShares | number | no* | |
tradePercent | number | no* | |
tradeAmount | number | no* | |
securityId | number | yes | |
tradeToolSelection | number | no** | 2=Acccount |
tradeInstanceType | number | no** | 5=Quick Trade |
tradeInstanceSubType | number | no** | 11=Quick Trade |
**tradeToolSelection, tradeInstanceType and tradeInstanceSubType shows how an account was chosen to trade, and which tool did the trading. They are optional, but without them, the Trade Instance metadata will be missing that information.
{
"application": "QuickTrades",
"trades": [
{
"action": 1,
"isSendImmediately": false,
"portfolioId": 227,
"accountId": 127,
"tradeShares": null,
"tradePercent": null,
"tradeAmount": 2100.57,
"securityId": 13
}
],
"tradeToolSelection": 2,
"tradeInstanceType": 5,
"tradeInstanceSubType": 11
}