0

Technical issue with etrade API.

I am constructing a trailing stop sell-to-close order with the following preview in Sandbox:

"{"PreviewOrderRequest":{"orderType":"OPTN","clientOrderId":"27099010699269ea2bee","Order":[{"allOrNone":"false","priceType":"TRAILING_STOP_CNST","orderTerm":"GOOD_FOR_DAY","marketSession":"REGULAR","trailPrice":".15","stopPrice":0,"Instrument":[{"Product":{"symbol":"MSFT","securityType":"OPTN","callPut":"CALL","expiryYear":"2021","expiryMonth":"9","expiryDay":"24","strikePrice":"290"},"orderAction":"SELL_CLOSE","orderedQuantity":"10","quantity":"10"}]}]}}"

However, in response, I am receiving the following error message:

"{"Error":{"code":7,"message":"You did not specify a stop price. Please fill in the missing information and resubmit your order."}}"

As you can see, I am setting the "stopPrice":0 in the order object. I put zero "0" since this is the value used in several examples from the documentation:

https://apisb.etrade.com/docs/api/order/api-order-v1.html#/definitions/OrderDetail

And I tried it as both a number and string: "stopPrice":"0" without success.

Is there a different field/value to set or format/configuration to make this work?

iamzeid
  • 104
  • 1
  • 2
  • 18
John Kelly
  • 39
  • 1
  • 4

1 Answers1

0

The obvious question is whether 0 is a valid value. I'd be surprised if it is, but it's easy to check.

BWhite
  • 713
  • 1
  • 7
  • 24
  • Good idea. Changed stopPrice to .01. It did not succeed but gave a different error message: {"Error":{"code":100,"message":"The requested service is not currently available, please try after sometime."}}. This maybe progress. However the correct answer will explain how to format a trailing stop order for etrade API. – John Kelly Sep 25 '21 at 22:36
  • First, that's a generic message that only means that something they didn't expect happened. It doesn't really mean that the service is "not currently available". That's just one option. Second, your trailPrice is in quotes but your stopPrice is not. Try mixing that up. – BWhite Sep 27 '21 at 00:35