Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options strangle orders with trigger? and should I just switch to a better api broker like IB or Etrade? #15

Open
matt1260 opened this issue May 17, 2022 · 1 comment

Comments

@matt1260
Copy link

matt1260 commented May 17, 2022

Hello,
I am full aware of the absurd lack of documentation on the api orders schema and what works and what doesn't. I kind of wonder if it is better to switch to a different broker with better api support. That said, I've spent enough time trying to figure out how to place an options trigger order for a strangle trade. There are no examples out there and I have copied existing templates for equities, but I'm just wasting my time at this point. This template doesn't work either. I have thinkorswim open to tell me if an order is placed or rejected right away, and this one is not getting a rejection or anything but the http 400 response:

trigger_order = {
  "orderType": "NET_DEBIT",
  "session": "NORMAL",
  "price": "1.97",
  "duration": "DAY",
  "orderStrategyType": "TRIGGER",
  "orderLegCollection": [
    {
      "instruction": "BUY_TO_OPEN",
      "quantity": 10,
      "instrument": {
        "symbol": "QQQ_051822P305",
        "assetType": "OPTION"
      }
    }
  ],
  "childOrderStrategies": [
    {
      "orderType": "NET_CREDIT",
      "session": "NORMAL",
      "price": "2.03",
      "duration": "DAY",
      "orderStrategyType": "SINGLE",
      "orderLegCollection": [
        {
          "instruction": "SELL_TO_CLOSE",
          "quantity": 10,
          "instrument": {
            "symbol": "QQQ_051822C308",
            "assetType": "OPTION"
          }
        }
      ]
    }
  ]
}

Any help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants