# Binance Grid Trader: a grid bot with a desktop interface

> Binance Grid Trader places orders on a price grid across Binance spot and futures markets, driven by a PyQt5 window or a headless script. It is a small, MIT licensed tool whose interesting design decisions are the separate market configuration, the strategy stored as readable JSON, and the explicit rule about symbol casing.

**51bitquant/binance_grid_trader** — Binance_grid_trader is a grid strategy bot trading with Binance Spot and Binance Futures Exchange. you can use it to trade any pair in Binance Exchange. Binance_grid_trader是一个币安网格策略软件, 目前支持币安现货，USDT合约和币币合约。

- Repository: https://github.com/51bitquant/binance_grid_trader
- Stars: 984 · Forks: 299
- Language: Python
- License: MIT
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/51bitquant-binance-grid-trader

## A window on top of a grid order loop

The project is a grid strategy bot for Binance Spot and Binance Futures, and you can use it to trade any pair on the exchange. The description also states that it currently supports Binance spot, USDT contracts and coin margined contracts, and the topics list mentions an OKEx API alongside the Binance one.

What you get is a Python application with a graphical front end. The main entry point opens a window, and the documentation shows a screenshot of it with buttons for configuring the API, adding a strategy, initialising it and starting it. Two additional entry points exist for running without the interface: main_futures_script.py for the futures market and main_spot_script.py for spot, which is the mode intended for a Linux server.

The dependencies show the shape of the thing. PyQt5 at a fixed 5.15.2 with the qdarkstyle package provides the dark themed interface, requests and aiohttp handle the HTTP side, websocket-client handles the streaming side, and tzlocal and six are pinned helper libraries. cryptography is there for the exchange API signing.

The design is worth reading as a desktop application for trading rather than as a service. Configuration is entered through dialogs, strategies are managed as rows, and starting and stopping is a button. For someone who runs one bot on one machine, that is a friendlier model than a configuration file and a cron job.

## The grid parameters and the arithmetic behind the step

A grid strategy is defined here by seven values for the futures side, with an extra one for spot, and the documentation describes each in turn.

The strategy name identifies the configuration. The symbol selects the market, and the futures type setting decides whether contracts are settled in USDT or BUSD, so a pair like BTCUSDT or BTCBUSD wants the USDT type and the coin margined option is the alternative.

The upper price is the top of the grid, and the bottom price is the bottom. Both also act as kill switches: if you set the upper price to 40000 and the market is above 40000, the strategy will not place any order, and the same applies below the bottom price. That is a useful property, because it means a grid does not keep quoting into a market that has left the range you meant it to trade.

The grid number sets how many steps the range is divided into. The documentation gives the arithmetic: with an upper price of 40000, a bottom price of 30000 and a grid number of 100, the step, or the order price step, is 100. The order volume is the quantity per order, and the maximum number of open orders caps how many orders may sit on the buy side and on the sell side at once.

The spot strategy adds one parameter, the investment coin, which is the asset your quote is held in: USDT for a pair such as btcusdt, BUSD for btcbusd, and btc for a pair like ethbtc. The reasoning is that a spot grid buys and sells one side of the pair, so you need to say which side you are holding.

## Symbol casing decides which market you end up in

There is a detail in the documentation that deserves a warning label, because it is silent about its consequences and consequential when it goes wrong.

For the futures market, the symbol has to be uppercase, so BTCUSDT or ETHBUSD. The documentation states that if you use the lower case, you will run in the Spot market. For the spot market, the symbol has to be lowercase, so btcusdt or ethbusd. In other words, the casing of the symbol is what selects the market, and getting it wrong does not raise an error, it routes your orders to the other venue.

That is a fine design for a desktop application where the market is chosen by a separate strategy type, and a poor one for a script where the only thing you change is a string. If you drive the headless scripts, the symbol in your configuration is the single point of control over which market receives your money.

The rest of the market selection is separate: the API configuration has a connect action for futures and a connect action for spot, and each writes to its own file. The futures type field adds one more decision: USDT and BUSD settled contracts both take the USDT setting, with COIN as the alternative.

## API keys land in JSON files in the project directory

The credential handling is simple, and that simplicity has a consequence worth understanding before you use it.

The application asks for a key and a secret, both taken from the exchange's own API management page, and the documentation reminds you to edit the API restrictions so that the key is allowed to trade. It also offers proxy host and proxy port fields, to be left blank if you can reach the exchange directly. If you run VPN software, the proxy host should be set to 127.0.0.1, and otherwise it should be the address of a remote proxy server.

All of that configuration is written to disk. The futures settings are saved in a connect_futures.json file in the project directory, and the spot settings in connect_spot.json. Both files therefore contain your API key and secret in plain text, inside a directory that is under version control, because the repository has a .gitignore and the developer presumably was careful, but the tool does not itself keep those files out of a commit.

Two pieces of advice follow directly from the documentation. Restrict the API key to trading permissions and to the addresses you use, so a leaked file is not a withdrawal key, and keep the project directory out of any repository or backup you share. The documentation also notes that the API has to be connected again, by clicking the confirm button, every time the grid strategy is run, which is a sensible habit even if it is mildly annoying.

## Running it, and running it without the window

The setup is a standard Python project setup, and the documentation is explicit about the sequence.

Create a virtual environment, with anaconda suggested:

```bash
conda create -n trader python==3.7
```

```bash
conda activate trader
```

Then install the libraries listed in the requirements file, which the project ships:

```bash
pip install -r requirements.txt
```

The dependency list is short and one of the entries is dated:

```bash
requests
websocket-client
qdarkstyle
PyQt5==5.15.2
tzlocal==2.1
six==1.13.0
wheel
cryptography
aiohttp
```

Python 3.7 is what the documentation asks for, and the pinned versions of PyQt5, tzlocal and six come from the same period. A current Python will install most of them, but the pinned interpreter is the configuration the project was written against.

Once the environment is ready you run the application:

```bash
python main.py
```

For a headless run on a server, pick the script that matches the market you intend to trade:

```bash
main_spot_script.py
```

```bash
main_futures_script.py
```

The difference between the two script files, according to the documentation, is that you have to edit them before running, which tells you that they carry the parameters that the window would otherwise collect from you.

## Strategy state on disk, and what the project does not do

The state of your configuration is inspectable, and that is one of the better properties of the tool.

The strategy settings live in a grid_strategy_setting.json file in the gridtrader directory, and the documentation says you can check it out and modify it. A second file, grid_strategy_data.json, holds some of the variables from the strategy while it is running. Between them, you can read what the bot thinks it is doing rather than trusting the interface, and you can hand-edit a setting and restart.

What the project does not offer is where the caution has to come from. There is no backtester, no simulation mode, no performance report, no drawdown calculation and no documented position sizing scheme beyond the order volume and the maximum open orders per side. The topic list mentions market making and quantitative finance, but the documentation is a user manual for placing orders, not a research toolkit.

The maintenance profile is similar. The repository is not archived and the last push was on 2026-06-07, so the code is still being touched, but the release history contains a single entry, V0.9.1 labelled V1.0, from 2022-04-11. There is no homepage and no project site, the documentation is in English, Chinese and Portuguese, and there is a tutorial video plus a Video-Instruction.md file for people who would rather watch than read. The API of the exchange itself is the other moving part, and exchange endpoints change, which is the usual reason a bot like this stops working without anyone touching the repository.

## Conclusion

Binance Grid Trader suits someone who already understands grid strategies and wants a working order placement loop for Binance spot or futures with a visual interface, not a research platform to discover one. It offers no backtesting, no performance figures and no documented risk controls beyond a maximum number of open orders per side, so it should not be pointed at real funds without a strategy you have validated elsewhere. Before you run it, move your API credentials out of the project directory, restrict the API key to trading only, and read grid_strategy_setting.json to confirm the grid bounds match the pair you intend to trade.

## FAQ

### How do I install and run Binance Grid Trader?

Create a Python environment, which the documentation suggests with conda create -n trader python==3.7, then run pip install -r requirements.txt and start the application with python main.py. For a headless run on Linux, use main_spot_script.py or main_futures_script.py, editing the relevant script first.

### How do I set the grid spacing for a strategy?

Set the upper price, the bottom price and the grid number, and the step is the range divided by the number of grids. The documentation's example is an upper price of 40000, a bottom price of 30000 and a grid number of 100, which gives a step of 100.

### Where are my Binance API credentials stored?

The futures configuration is written to gridtrader/connect_futures.json and the spot configuration to gridtrader/connect_spot.json, both inside the project directory and in plain text. Restrict the API key to trading permissions in the exchange's API management settings, and keep those files out of any repository you share.

### What is the difference between the futures and spot strategy?

The futures strategy takes a futures type setting for USDT or BUSD margined contracts, and the spot strategy adds an invest_coin field naming the asset your quote is held in, such as USDT, BUSD or btc. Symbol casing also differs: futures use an uppercase symbol and spot uses a lowercase one, and the documentation notes that the wrong casing sends you to the other market.

## Sources

- [51bitquant/binance_grid_trader on GitHub](https://github.com/51bitquant/binance_grid_trader)
- [Issues](https://github.com/51bitquant/binance_grid_trader/issues)
- [License: MIT](https://github.com/51bitquant/binance_grid_trader/blob/master/LICENSE)
- [README](https://github.com/51bitquant/binance_grid_trader/blob/master/README.md)
- [Releases](https://github.com/51bitquant/binance_grid_trader/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/51bitquant-binance-grid-trader
