Giter Club home page Giter Club logo

Comments (4)

haxdds avatar haxdds commented on May 20, 2024 1

Hey @sshcli

Unfortunately, although it would be nice to have, it isn't a priority at the moment.

A work around is to fetch all open orders for that symbol and then cancel them.

It would look something like this

filter = GetOrdersRequest(symbols=["AAPL"])

orders = trading_client.get_orders(filter)

for o in orders:
    trading_client.cancel_order_by_id(o.id)

from alpaca-py.

sshcli avatar sshcli commented on May 20, 2024

Hey Mates!
Any news on this one?
At least can someone share an easy and simple workaround to this one?
Thanks in advance for your comments

from alpaca-py.

sshcli avatar sshcli commented on May 20, 2024

A work around is to fetch all open orders for that symbol and then cancel them.

Thanks,
I have tested the above code with alpaca-py(0.5.1) adding from alpaca.trading.requests import MarketOrderRequest and it works ok.

But...
I'm using alpaca-trade-api (2.3.0) in my algo/bot, I don't want to mix things

  1. is there a similar solution for alpaca-trade-api (2.3.0) ?
  2. Do you recommend to start migrating to alpaca-py(0.5.1) ASAP?

Thanks in advance for your response.

Regards,

from alpaca-py.

sshcli avatar sshcli commented on May 20, 2024
  1. is there a similar solution for alpaca-trade-api (2.3.0) ?
  2. Do you recommend to start migrating to alpaca-py(0.5.1) ASAP?

Forget it, I just saw the Deprecation Notice in the other repo.
Great job !
Let's move forward

from alpaca-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.