pyetrade
pyetrade copied to clipboard
[Warning!] ETrade API *sever* bug: Stop Price and Trailing Stop Parameter are swapped!
with this parameter:
[ place_equity_order()] {'accountId': 'xxx', 'symbol': 'STLD', 'orderAction': 'SELL', 'clientOrderId': xxx,
'priceType': 'TRAILING_STOP_CNST', 'offsetType': 'TRAILING_STOP_CNST',
'offsetValue': '0.66', 'trailPrice': '0.66', 'stopPrice': '64.49', 'allOrNone': False,
'quantity': 50, 'orderTerm': 'GOOD_UNTIL_CANCEL', 'marketSession': 'REGULAR'}
I saw the placed order is:
STLD
Initial Stop Price: 0.66
Trailing Stop Parameter: 64.49 point(s) below bid
This is ridiculous: the Initial Stop Price and Trailing Stop Parameter are swapped!
I contacted ETrade customer service, this is what they said:
The current trailing stop price is set in "stopPrice" field
I cannot believe it, looks like they are not going to fix their bugs!
@mw66 I appreciate the heads up but I am unsure what to do with this issue. I think the best course of action for this project would be to make a known issues section in the docs.
Yes, let's doc it.
This drove me nuts for a day. See instruction on page 22 here:
stopPrice
The designated boundary price for a stop order. For trailing stop orders this will
represent the dollar amount or percentage trailing value. Enter percentages as
whole numbers.
A PreviewOrderRequest example for options:
<PreviewOrderRequest>
<Order>
<Instrument>
<Product>
<callPut>CALL</callPut>
<expiryDay>...</expiryDay>
<expiryMonth>...</expiryMonth>
<expiryYear>...</expiryYear>
<securityType>OPTN</securityType>
<strikePrice>4.00</strikePrice>
<symbol>...</symbol>
</Product>
<orderAction>SELL_CLOSE</orderAction>
<quantity>1</quantity>
</Instrument>
<allOrNone>false</allOrNone>
<marketSession>REGULAR</marketSession>
<orderTerm>GOOD_UNTIL_CANCEL</orderTerm>
<priceType>TRAILING_STOP_CNST</priceType>
<offsetType>TRAILING_STOP_CNST</offsetType>
<stopPrice>0.15</stopPrice>
</Order>
<clientOrderId>...</clientOrderId>
<orderType>OPTN</orderType>
</PreviewOrderRequest>
- do not pass
trailPricefor trailing stops; pass that value viastopPrice - API does not allow
TRAILING_STOP_PRCTorders on options, so you'll have to stick toTRAILING_STOP_CNST's