algorithmic-trading - 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"
没有成功。
是否有不同的字段/值要设置或格式/配置来完成这项工作?
解决方案
显而易见的问题是 0 是否是有效值。如果是,我会感到惊讶,但很容易检查。
推荐阅读
- javascript - JavaScript如何获取按钮是否处于活动状态(单击后)
- python - 在枚举值中使用类函数时,“函数”对象没有属性“值”
- ios - SwiftUI,iOS:如何从自定义内部视图访问 @main 结构内的公共函数?
- c# - WinUI:是否可以在 NavigationViewItemHeader 中显示除文本以外的任何内容
- python - Dagster 运行多个项目的管道
- linux - 在linux的sh文件中添加大数
- r - R中的对数转换函数
- c++ - 在 C++ 编程中,main() 函数是像 java 中的静态函数还是像 C 中的非静态函数?
- javascript - React Native App - 在标题和选项卡导航器上添加触发特定屏幕功能的按钮
- python - 如何为我的 oem_data 程序使用多线程来支持多个设备?