placechangeequityorder会导致“现有未结订单”错误

时间:2017-10-14 20:43:57

标签: etrade-api

我使用https://etws.etrade.com/order/rest/placeequityorder成功向E * Trade提交股票订单:

<PlaceEquityOrder xmlns="http://order.etws.etrade.com">
  <EquityOrderRequest>
    <clientOrderId>1507910303000001</clientOrderId>
    <accountId>xxx</accountId>
    <quantity>1</quantity>
    <orderAction>BUY</orderAction>
    <priceType>LIMIT</priceType>
    <marketSession>REGULAR</marketSession>
    <orderTerm>GOOD_FOR_DAY</orderTerm>
    <symbol>TEUM</symbol>
    <limitPrice>0.6</limitPrice>
  </EquityOrderRequest>
</PlaceEquityOrder>

E * Trade确认订单确定无效:

<PlaceEquityOrderResponse>
  <equityOrderResponse>
    <accountId>xxx</accountId>
    <allOrNone>false</allOrNone>
    <estimatedCommission>6.95</estimatedCommission>
    <estimatedTotalAmount>7.55</estimatedTotalAmount>
    <messageList>
      <message>
        <msgDesc>Your order was successfully entered during market hours.</msgDesc>
        <msgCode>1026</msgCode>
      </message>
    </messageList>
    <orderNum>10</orderNum>
    <orderTime>1507924703308</orderTime>
    <quantity>1</quantity>
    <reserveOrder>false</reserveOrder>
    <reserveQuantity>0</reserveQuantity>
    <orderTerm>GOOD_FOR_DAY</orderTerm>
    <limitPrice>0.6</limitPrice>
    <stopPrice>0</stopPrice>
    <symbolDesc>PARETEUM CORP COM NEW</symbolDesc>
    <symbol>TEUM</symbol>
    <orderAction>BUY</orderAction>
    <priceType>LIMIT</priceType>
  </equityOrderResponse>
</PlaceEquityOrderResponse>

然后我尝试使用https://etws.etrade.com/order/rest/placechangeequityorder更新限价:

<placeChangeEquityOrder xmlns="http://order.etws.etrade.com">
  <changeEquityOrderRequest>
    <orderNum>10</orderNum>
    <clientOrderId>1507910303000001</clientOrderId>
    <accountId>xxx</accountId>
    <quantity>1</quantity>
    <orderAction>BUY</orderAction>
    <priceType>LIMIT</priceType>
    <marketSession>REGULAR</marketSession>
    <orderTerm>GOOD_FOR_DAY</orderTerm>
    <symbol>TEUM</symbol>
    <limitPrice>0.61</limitPrice>
  </changeEquityOrderRequest>
</placeChangeEquityOrder>

但是

拒绝改变
> <Error><ErrorCode>1028</ErrorCode><ErrorMessage>You have an existing
> open order for this security on the same side of the market. If you
> did not intend to place a second order for this security, please click
> Cancel Order ; otherwise, click  Trade  to
> proceed.</ErrorMessage></Error> ---> System.Net.WebException: The
> remote server returned an error: (400) Bad Request.

我试过包含但不包括clientOrderId,它没有任何区别。我疯了,因为同样的代码在当天早些时候运行良好,然后再也没有用了。

如果您能够使用E Trade API提交订单更改,请告知我们。 E Trade API论坛似乎已经消失:(

1 个答案:

答案 0 :(得分:0)

需要为每个更改请求提交一个新的clientOrderId。我假设一个人应该继续发送原始的clientOrderId(首次提交订单时使用的那个)。