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

[Bug]: Cannot open bracket order starting with sell stop #248

Open
1 task done
williamaditama opened this issue Jul 25, 2023 · 0 comments
Open
1 task done

[Bug]: Cannot open bracket order starting with sell stop #248

williamaditama opened this issue Jul 25, 2023 · 0 comments

Comments

@williamaditama
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I call the alpaca api with

{
    symbol: 'SPY',
    qty: 35,
    side: 'sell',
    type: 'stop',
    order_class: 'bracket',
    stop_price: 455.67,
    time_in_force: 'day',
    take_profit: { limit_price: 455 },
    stop_loss: { stop_price: 455.96 }
  }

It returned an error:

{ code: 42210000, message: 'bracket orders must be entry orders' }

Expected Behavior

No response

SDK Version I encountered this issue in

@alpacahq/alpaca-trade-api ^3.0.1

Steps To Reproduce

Call:

alpaca.createOrder({
    symbol: 'SPY',
    qty: 35,
    side: 'sell',
    type: 'stop',
    order_class: 'bracket',
    stop_price: 455.67,
    time_in_force: 'day',
    take_profit: { limit_price: 455 },
    stop_loss: { stop_price: 455.96 }
  })


### Filled out the Steps to Reproduce section?

- [X] I have entered valid steps to reproduce my issue or have attached a minimally reproducible case in code that shows my issue happening; and understand that without this my issue will be flagged as invalid and closed after 30 days.

### Anything else?

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

1 participant