首页 > 解决方案 > Etrade API 响应在请求有效负载中指示缺少“stopPrice”字段/值

问题描述

etrade API 的技术问题。

我正在使用 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"}]}]}}"

但是,作为回应,我收到以下错误消息:

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

如您所见,我"stopPrice":0在 order 对象中设置。我输入了零"0",因为这是文档中几个示例中使用的值:

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

我尝试将它作为数字和字符串:"stopPrice":"0"没有成功。

是否有不同的字段/值要设置或格式/配置来完成这项工作?

标签: algorithmic-tradingetrade-api

解决方案


显而易见的问题是 0 是否是有效值。如果是,我会感到惊讶,但很容易检查。


推荐阅读