• No se han encontrado resultados

Currículum oculto

In document Los hijos de las Reformas Laborales. (página 63-68)

N o tiene ninguna relación

3.3 Currículum oculto

Throughout this documentation, the terms "submit" and "place" refer to entering an order into

the system to be executed. The actual execution of the order depends on a variety of

circumstances. To receive timely notification of the order status, use the streaming order status

API, detailed elsewhere in this documentation.

The related Preview Option Order Change API returns a preview of an order change that

includes estimated order cost and a unique preview ID. It is possible to submit an order change

without first previewing it, but a typical workflow lets the user preview the order change first. Be

aware that, once the change has been previewed, submitting it requires that it include the

preview ID and the same parameters that were used in the preview.

URL

https://etws.etrade.com/order/rest/placechangeoptionorder

HTTP Method: POST

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

Request Parameters

Parameter Type Required? Description accountId integer required Numeric account ID

orderNum integer required Order number that identifies the order to be changed 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.

previewId long conditional If the change was not previewed, this parameter should not be specified. If the change was previewed, this parameter must specify the numeric preview ID from the preview, and other parameters of this request must match the parameters of the preview.

E*TRADE Developer Platform 197 Place Option Order Change

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 option order, requires a

stopLimitPrice

.

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.

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

stopLimitPrice double conditional The designated price for a stop-limit order. Required if

priceType is 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 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 displayed for a reserve order. Required if reserveOrder is TRUE.

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)

Response Properties

Property Type Description

accountId integer Numeric account ID

allOrNone boolean If TRUE, the transactions specified in the order must be executed all at once, or not at all.

estimatedCommission double The cost billed to the user to perform the requested action estimatedTotalAmount double The cost or proceeds, including broker commission, resulting

from the requested action

orderNum integer Numeric ID for this order in the E*TRADE system orderTime long The time the order was submitted, in epoch time

previewTime long The time of the preview referenced in the change request, if any

E*TRADE Developer Platform 198 Place Option Order Change

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. optionSymbol complex Container for the option identifier

symbol string The market symbol for the underlier callOrPut string Option type - specifies either CALL or PUT strikePrice double The strike price for this option

expirationYear integer The 4-digit year the option will expire expirationMonth integer The month (1-12) the option will expire expirationDay integer The day (1-31) the option will expire 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.

stopLimitPrice double The designated price for a stop-limit order. Required if

E*TRADE Developer Platform 199 Place Option Order Change

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

• BUY • SELL • BUY_OPEN • SELL_OPEN

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

• AUTO • AMEX • BOX • CBOE • ISE • NOM • NYSE • PHX

Sample Request

Request URL

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

Request Parameters - XML

<placeChangeOptionOrder xmlns="http://order.etws.etrade.com"> <changeOptionOrderRequest> <accountId>83405188</accountId> <orderNum>258</orderNum> <clientOrderId></clientOrderId> <previewId></previewId> <limitPrice>10</limitPrice> <stopPrice></stopPrice> <stopLimitPrice></stopLimitPrice> <allOrNone></allOrNone> <quantity>2</quantity> <reserveOrder></reserveOrder> <reserveQuantity></reserveQuantity> <priceType>LIMIT</priceType> <orderTerm>GOOD_FOR_DAY</orderTerm> </changeOptionOrderRequest> </placeChangeOptionOrder>

Request Parameters - JSON

{

"placeChangeOptionOrder": {

"-xmlns": "http://order.etws.etrade.com", "changeOptionOrderRequest": {

E*TRADE Developer Platform 200 Place Option Order Change "orderNum": "258", "limitPrice": "10", "quantity": "2", "priceType": "LIMIT", "orderTerm": "GOOD_FOR_DAY" } } }

Sample Response - XML

<PlaceChangeOptionOrderResponse> <optionOrderResponse> <accountId>83405188</accountId> <allOrNone>false</allOrNone> <estimatedCommission>9.49</estimatedCommission> <estimatedTotalAmount>2054.53</estimatedTotalAmount> <messageList> <message> <msgDesc>

Your order was successfully entered during market hours. </msgDesc> <msgCode>1026</msgCode> </message> </messageList> <orderNum>260</orderNum> <orderTime>1269431139424</orderTime> <previewTime>0</previewTime> <previewId>0</previewId> <quantity>2</quantity> <reserveOrder>false</reserveOrder> <reserveQuantity>0</reserveQuantity> <orderTerm>GOOD_FOR_DAY</orderTerm> <limitPrice>10</limitPrice> <optionSymbol> <symbol>IBM</symbol> <callOrPut>CALL</callOrPut> <strikePrice>175.000000</strikePrice> <expirationYear>2010</expirationYear> <expirationMonth>10</expirationMonth> <expirationDay>16</expirationDay> </optionSymbol> <orderAction>BUY_OPEN</orderAction> <priceType>LIMIT</priceType> </optionOrderResponse> </PlaceChangeOptionOrderResponse>

Sample response – JSON

{

"PlaceChangeOptionOrderResponse": { "optionOrderResponse": {

In document Los hijos de las Reformas Laborales. (página 63-68)