• No results found

Since this is a POST request, the parameters are included in the request as XML or JSON.

In document E*trade API Technical Documentation (Page 144-147)

Request Parameters

Parameter Type Required? Description accountId integer required Numeric account ID

symbol string required The market symbol for the security being bought or sold orderAction enum required The action that the broker is requested to perform. Possible

values are: • BUY • SELL

• BUY_TO_COVER • SELL_SHORT

clientOrderId string required A reference number generated by the developer. Used to ensure that a duplicate order is not being submitted. It can be any value of 20 alphanumeric characters or less, but must be unique within this account. It does not appear in any API responses.

priceType enum required The type of pricing. Possible values are: • MARKET

• LIMIT • STOP • STOP_LIMIT

• MARKET_ON_CLOSE

If STOP, requires a

stopPrice

. If LIMIT, requires a

limitPrice

. If STOP_LIMIT equity order, requires both. limitPrice double conditional The highest price at which to buy or the lowest price at which

to sell if specified in a limit order. Required if priceType is LIMIT or STOP_LIMIT.

E*TRADE Developer Platform 145 Preview Equity Order

stopPrice double conditional The price at which to buy or sell if specified in a stop order. Required if priceType is STOP or STOP_LIMIT.

allOrNone boolean optional If TRUE, the transactions specified in the order must be executed all at once, or not at all. Default is FALSE. quantity integer required The number of shares to buy or sell

reserveOrder boolean optional If set to TRUE, publicly displays only a limited number of shares (the reserve quantity), instead of the entire order, to avoid influencing other traders. Default is FALSE. If TRUE, must also specify the reserveQuantity.

reserveQuantity integer conditional The number of shares to be publicly displayed if this is a reserve order. Required if reserveOrder is TRUE. marketSession enum required Session in which the equity order will be placed. Possible

values are: REGULAR, EXTENDED.

orderTerm enum required Specifies the term for which the order is in effect. Possible values are:

• GOOD_UNTIL_CANCEL • GOOD_FOR_DAY

• IMMEDIATE_OR_CANCEL (only for limit orders) • FILL_OR_KILL (only for limit orders)

routingDestination enum optional The exchange where the order should be executed. Users may want to specify this if they believe they can get a better order fill at a specific exchange, rather than relying on the automatic order routing system. Possible values are: • AUTO (default)

• ARCA • NSDQ • NYSE

Response Properties

Property Type Description

accountId integer Numeric account ID

allOrNone boolean If TRUE, the transactions are to be executed all at once, or not at all.

estimatedCommission double The estimated commission

estimatedTotalAmount double The estimated total cost or proceeds, including commission messageList complex Container for messages describing the result of the action

message complex Container for a result message

msgDesc string Text of the result message, indicating order status, success or failure, additional requirements that must be met before placing the order, etc. Applications typically display this message to the user, which may result in further user action.

msgCode integer Standard numeric code of the result message. Refer to the Error Messages documentation for examples. May optionally be displayed to the user, but is primarily intended for internal use. previewTime long The time of this preview, in epoch time

E*TRADE Developer Platform 146 Preview Equity Order

previewId long Numeric preview ID

quantity integer The number of shares to buy or sell

reserveOrder boolean If TRUE, this is a reserve order - meaning that only a limited number of shares will be publicly displayed, instead of the entire order, to avoid influencing other traders.

reserveQuantity integer The number of shares to be publicly displayed if this is a reserve order

orderTerm string Specifies the term for which the order is in effect. Possible values are:

• GOOD_UNTIL_CANCEL • GOOD_FOR_DAY

• IMMEDIATE_OR_CANCEL (only for limit orders) • FILL_OR_KILL (only for limit orders)

priceType string The type of pricing. Possible values are: • MARKET

• LIMIT • STOP • STOP_LIMIT

• MARKET_ON_CLOSE

limitPrice double The highest price at which to buy or the lowest price at which to sell if specified in a limit order. Returned if priceType is LIMIT.

stopPrice double The price at which a stock is to be bought or sold if specified in a stop order. Returned if priceType is STOP.

symbolDesc string Text description of the security

symbol string The market symbol for the stock being bought or sold

orderAction string The action the broker is requested to perform. Possible values are: • BUY

• SELL

• BUY_TO_COVER • SELL_SHORT

orderTime long The time the order was submitted

routingDestination string The exchange where the user requests that the order be executed. Possible values are:

• AUTO • ARCA • NSDQ • NYSE

Sample Request

Request URL

POST https://etwssandbox.etrade.com/order/sandbox/rest/previewequityorder

E*TRADE Developer Platform 147 Preview Equity Order

Request Parameters - XML

<PreviewEquityOrder xmlns="http://order.etws.etrade.com"> <EquityOrderRequest> <accountId>83405188</accountId> <limitPrice></limitPrice> <stopPrice>197</stopPrice> <allOrNone></allOrNone> <quantity>4</quantity> <reserveOrder></reserveOrder> <reserveQuantity></reserveQuantity> <symbol>IBM</symbol> <orderAction>BUY</orderAction> <priceType>STOP</priceType> <routingDestination></routingDestination> <marketSession>REGULAR</marketSession> <orderTerm>GOOD_FOR_DAY</orderTerm> <clientOrderId>random123456</clientOrderId> </EquityOrderRequest> </PreviewEquityOrder>

In document E*trade API Technical Documentation (Page 144-147)