0

I successfully submit an equity order to E*Trade using https://etws.etrade.com/order/rest/placeequityorder:

<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>

The order is confirmed ok by 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>

Then I try to update the limit price with 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>

But the change is rejected with

> <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.

I tried including and not including clientOrderId, it made no difference. I'm going nuts because the same code worked fine once earlier in the day, then it never worked again.

If you are able to submit changes to orders using the ETrade API, please let me know. ETrade API forum seems to have disappeared :(

Jimmy
  • 4,610
  • 8
  • 51
  • 71

1 Answers1

0

One needs to submit a new clientOrderId with every change request. I had assumed that one was supposed to keep sending the original clientOrderId (the one used when first submitting the order).

Jimmy
  • 4,610
  • 8
  • 51
  • 71