jessecooper / pyetrade

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

Are contingent orders actually supported? #53

Open mw66 opened 2 years ago

mw66 commented 2 years ago

Hi,

I'm reading this doc:

https://apisb.etrade.com/docs/api/order/api-order-v1.html#/definitions/OrderDetail

conditionType string The type of comparison to be used in a conditional order (contingent orders are not supported in API currently) CONTINGENT_GTE, CONTINGENT_LTE
conditionFollowPrice string In a conditional order, the type of price being followed ASK, BID, LAST

And found it's confusing: on one hand, the doc listed all the fields needed by the contingent orders, on the other hand, it also says: it's not supported.

So I am wondering if it's actually supported?

Has anyone tried to place contingent orders using API before? What's your experience?

Thanks!

chotaGit commented 2 years ago

There is a placeholder for contingent orders in the API but doesn't seem to work. Tried the following with no luck.

{
    "PreviewOrderRequest": {
        "orderType": "OPTN",
        "clientOrderId": "20220106-TSLACBO42",
        "Order": [
            {
                "allOrNone": "false",
                "priceType": "LIMIT",
                "limitPrice": "0.01",
                "orderTerm": "GOOD_FOR_DAY",
                "marketSession": "REGULAR",
                "conditionSymbol": "TSLA",
                "conditionType": "CONTINGENT_LTE",
                "conditionFollowPrice": "LAST",
                "conditionPrice": "980",
                "Instrument": [
                    {
                        "Product": {
                            "symbol": "TSLA",
                            "securityType": "OPTN",
                            "callPut": "CALL",
                            "expiryYear": "2022",
                            "expiryMonth": "01",
                            "expiryDay": "07",
                            "strikePrice": "1100"
                        },
                        "orderAction": "BUY_OPEN",
                        "orderedQuantity": "1",
                        "quantity": "1"
                    }
                ]
            }
        ]
    }
}
{
    "Error": {
        "code": 9999,
        "message": "Please validate the input and try again"
    }
}