jessecooper / pyetrade

Python E-Trade API Wrapper
GNU General Public License v3.0
205 stars 96 forks source link

[Warning!] ETrade API *sever* bug: Stop Price and Trailing Stop Parameter are swapped! #57

Open mw66 opened 2 years ago

mw66 commented 2 years ago

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!

jessecooper commented 2 years ago

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

mw66 commented 2 years ago

Yes, let's doc it.

rahulrajaram commented 1 year ago

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>