Clockwork Robot holding a red trending upward in steps arrow.
Python Trading Bot

Python Trading Bot

How to List all Your Open Orders on Binance with Python

James Hinton
Published in
2 min readNov 23, 2022


When running an algorithmic trading bot, there are times when it’s handy to list all your open trades. This can give you a rapid overview of your various risk factors, and your currently open commitments.

You can do this programmatically through Binance, using their advanced API. Even better, if you’re using Python, they have an official Python Library to help make life easier.

The Binance API documentation can be slightly confusing/overwhelming to work through, so I’ve extracted a few bits and pieces to construct the function below.

Update August 2023

I could never have anticipated how popular this blog, along with a YouTube channel would become.

After a listening to my readers/viewers feedback, I realized that many people were spending huge amounts of time trying to solve installation/configuration problems — rather than experiencing the joy of algorithmic trading.

I want to change this narrative — and in so doing, open up algorithmic trading for everyone.

To do this, I’ve recently launched Tradeoxy: Trading For Everyone.

If you’re reading this, Tradeoxy will simplify 90% of this series, using a series of powerful API’s and easy to use tooling.

Currently it’s in the early-access / building stage and I’d be incredibly grateful if you’d join us on this adventure. Your feedback will help us shape a better product.

Join the early access program (for free) here.

You can also view our launch video, and follow our journey on LinkedIn, Twitter, Instagram, YouTube.


  1. You’ve connected to the Binance API using an api_key and api_secret_key
  2. You’re using the Binance Testnet as well as their live Spot trading
  3. You’ve received a binance_testnet_api_key and binance_testnet_secret_key
  4. You know how to trade and the risks involved

P.S. If you’d like to see the full story on developing all the connections and keys you need in Python, check out my series “How to



James Hinton

Passionate algorithmic trader and Cyber Security expert. Love developing helpful content.

Recommended from Medium


See more recommendations