Binance
Reference for trading on Binance with Neurotrader: environments, markets, order mapping, limits, connection loss, fees, and what Neurotrader does not model or do.
Look here when you need to know exactly what happens to an algorithm's orders at Binance: which orders can be expressed, how prices and quantities are adjusted, what Binance limits, and what Neurotrader leaves to you.
In the two venue modes, Binance decides what happens to an order. Neurotrader sends the order, records what Binance answers, and computes no fill, fee or balance itself.
Supported scope
| Area | Supported |
|---|---|
| Market | Spot |
| Environments | Demo Mode (practice funds) and the production exchange (real funds) |
| Modes | Live Paper Trade in Demo Mode, Real Trade in production |
| Account | One Binance account in each environment, each through its own stored credential |
| Algorithms per run | One. Several strategies run as one algorithm group |
| Key type | Ed25519, self-generated. See Venue account connection |
| Market data | Binance's public candle stream. See Market data providers |
Not supported: margin and borrowing, futures, options, and withdrawals. A venue run with margin terms is refused. See Deliberate absences.
Environments
| Demo Mode | Production | |
|---|---|---|
| Shown in the app as | Binance Demo Mode, demo funds | Binance Live, real funds |
| Keys are made at | demo.binance.com | www.binance.com |
| Funds | Practice funds, reset on Binance's Demo site | Your real balance |
| Trading rules and limits | The same as production | Binance's |
| Safety rules | None | Real trading safety |
A run declares its environment when it is created, and the environment cannot be reached by any other setting. A key issued for one environment is refused in the other before the run starts.
In both environments the candles the algorithm sees come from the real market. Only the orders of a demo run go to the Demo environment. Demo prices and order books are similar to the real exchange's, not identical, so a fill in Demo Mode is not proof of the same fill in production.
Production trading is governed by two rules: built-in algorithms are refused there, and your own algorithms need a confirmation first. See Real trading safety.
Start checks
Before the first step of a venue run, Neurotrader reads the account and the rules from Binance. The start is refused, with the reason, when:
| Check | Refused when |
|---|---|
| Credential | None is stored, it awaits its API key, it is not Ed25519, or it belongs to another environment |
| Key permissions | The key cannot trade, or (production) the key can withdraw |
| Instruments | An instrument is not open for trading at Binance |
| Open orders | Orders are already open at Binance on the run's instruments |
| Balance | The account holds neither the quote asset nor any asset the run trades |
Neurotrader never adopts orders it did not place. Cancel them at Binance, or end the previous run with Close, before you start.
Order mapping
Order types
| Order in Neurotrader | Order at Binance |
|---|---|
| Market | MARKET |
| Limit | LIMIT |
| Stop market | STOP_LOSS or TAKE_PROFIT, chosen by side and by where the trigger sits against the last price |
| Stop limit | STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT, chosen the same way |
| Stop loss | STOP_LOSS |
| Take profit | TAKE_PROFIT |
Time in force: good till cancelled, immediate or cancel, and fill or kill are sent as they are. Good till date has no equivalent on Binance spot and is refused before it is sent.
A stop order whose trigger is already crossed is rejected by Binance ("Order would trigger immediately").
Prices and quantities
Binance accepts only prices on the instrument's tick grid and quantities on its step grid. Neurotrader applies these rules before sending:
| Value | Rule |
|---|---|
| Price | Never moved. A limit or stop price off the tick grid is refused, because a moved price is a different order |
| Quantity | Rounded down to the step. Never rounded up |
| Too small | An order whose rounded quantity is under the minimum quantity, or whose value is under the minimum notional, is refused. It is not enlarged to fit |
The journal, the fills and the open orders show the values that were sent, not the ones the algorithm asked for.
Venue filters
Binance publishes limits per instrument, and Neurotrader checks an order against them before sending it. A refusal names the filter in Binance's own words, whether Neurotrader or Binance refused.
| Filter | Limits |
|---|---|
PRICE_FILTER | The tick size and the allowed price range |
LOT_SIZE | The quantity step, minimum and maximum |
MARKET_LOT_SIZE | The largest single market order |
NOTIONAL | The smallest and largest order value |
PERCENT_PRICE_BY_SIDE | How far from the market a price may sit |
MAX_NUM_ORDERS | Open orders per instrument |
MAX_NUM_ALGO_ORDERS | Open stop and take-profit orders per instrument |
The values differ per instrument. For BTCUSDT, for example, the tick size
is 0.01, the quantity step is 0.00001, the minimum order value is 5 USDT,
and at most 5 stop or take-profit orders may be open at once.
Binance measures the price band against its own average price over the last minutes, which Neurotrader does not see. An order near the edge of the band can pass Neurotrader's check and be rejected by Binance. The rejection is recorded like any other.
Order outcomes
| At Binance | In Neurotrader |
|---|---|
| Accepted | Open |
| Partly filled | Partially filled, with one fill per trade |
| Filled | Filled |
| Cancelled | Canceled, recorded when Binance confirms it, not when the cancel was requested |
| Rejected | Rejected, with Binance's reason |
| Expired | Expired, with Binance's reason |
| Expired by self-trade prevention | Expired, marked as self-trade prevented |
Each placement waits up to five seconds for Binance's answer, so a rejection is recorded at the step that caused it.
Order closure
When an algorithm closes one of its orders, Neurotrader cancels it if it never traded. If it traded, Neurotrader places a market order on the opposite side for the filled quantity, less any fee taken in the traded asset. If that market order fills only in part, the rest stays as a position.
Differences from simulation
An algorithm runs unchanged in every mode, but the venue is not the simulator. These are the differences that change results.
| Subject | In simulation | At Binance |
|---|---|---|
| Triggered stops | The stop is retired and a new order carries the execution | The stop keeps its one order and reports its own fills |
| Stop orders per instrument | No limit | Limited by MAX_NUM_ALGO_ORDERS |
| Far-from-market limit orders | Accepted | Can be rejected by the price band |
| Quantities | Used as given | Rounded down to the step |
| Your own orders crossing | Not modelled | Binance prevents the trade: the resting order expires and the incoming order goes on |
| Fills | Against the candle | By Binance's order book, possibly in parts and at several prices |
| Fees | The maker and taker fees you set | What Binance charges on each fill |
| Balance | The starting balance you set | The account at Binance |
Account and results
- Balances come from Binance and update as Binance reports changes. A run tracks the assets its instruments trade. Other assets in the account are ignored, so the net worth shown is this run's part of the account.
- Net worth is valued in the run's primary quote asset, using the candles the run receives.
- Positions are derived from the run's own fills. Spot has no positions at Binance, and what the account held before the run is not counted as the run's.
- Every fill is recorded once, identified by Binance's trade id, also when it is learned twice (live and again after a reconnect).
Fees
Binance charges the fee on each fill and reports the amount and the asset. Neurotrader records exactly that. A venue run has no fee settings.
- The fee can be charged in an asset other than the two being traded, for example in BNB when your Binance account pays fees that way.
- Your fee rate depends on your Binance account and can differ per instrument.
- A run's results list fees per asset. They are not converted into one total.
Compare a demo run's fees with the maker and taker fees you set in your simulations, and adjust the simulations if they differ. See Fees.
Rate limits
Binance limits how much one connection and one account may ask. The limits Binance publishes for spot:
| Limit | Value |
|---|---|
| Request weight | 6,000 per minute, per IP address |
| Orders | 100 per 10 seconds, per account |
| Orders | 200,000 per day, per account |
| Raw requests | 300,000 per 5 minutes |
An algorithm decides once per closed candle, so normal trading stays far below these. Neurotrader still keeps count:
- It tracks the usage Binance reports with every answer and waits before sending when the budget is used up.
- When Binance answers that the limit is reached, Neurotrader waits for the time Binance names before it sends again. The run reports the condition in Conditions.
- A stop with Close on a large book of orders is paced by the same budget.
The limits count per IP address and per account. Other software using the same Binance account or the same internet connection spends the same budget.
Connection loss
| Event | Behaviour |
|---|---|
| Binance closes the connection after 24 hours (scheduled) | Reconnects before or when it happens, signs in again |
| The connection drops | Reconnects with increasing waits, signs in again |
| After any reconnect | Asks Binance for the open orders, the balances, and the state and trades of every order that was working, and records what happened in the gap |
| A request gets no answer, or a server error | Treats the outcome as unknown and asks Binance about that order. It never sends the order a second time |
| An order Binance does not know after an unknown outcome | Recorded as rejected, with the reason not accepted by the venue |
| Binance announces maintenance | Reports it in Conditions and reconnects afterwards |
| The key is revoked or loses its permission | Stops reconnecting. The run can no longer trade: stop it and check the account at Binance |
| The candle stream drops | Reconnects and fetches the missed candles. See Market data providers |
While the connection is down, the algorithm is still called at every step. Orders already at Binance keep working there, and can fill.
Each of these events appears in the run's Conditions list when it begins and when it ends.
If the engine or the computer stops while a run is up, the run's orders stay at Binance. See Demo runs.
Deliberate absences
| Neurotrader does not | Reason |
|---|---|
| Borrow or trade on margin at Binance | Venue trading is spot only |
| Send order groups in which one order cancels the other (OCO) | Such a group is refused before it is sent, with the reason, and never approximated with separate orders |
| Send good-till-date orders | Binance spot has no such order, and a timer on your computer would only hold while the computer runs |
| Change an order in place | An algorithm cancels and places again |
| Adopt orders that were already at Binance | The algorithm does not know them. The start is refused instead |
| Reattach to orders after an ungraceful end | The record says what was outstanding, and you resolve it at Binance |
| Sell what the account held before the run | Close closes only what the run's own fills built |
| Withdraw, deposit or transfer | Never needed. A production key that can withdraw is refused |
| Decide whether you may use Binance | Eligibility is Binance's decision for your country and account |
| Hold your key on a server | The key stays in your computer's key store, and orders go from your computer to Binance |
| Limit what an algorithm does | The start confirmation limits nothing. What a running algorithm does is the algorithm's |
Neurotrader is not a broker and gives no financial advice. With a production key, losses are real and are yours.
Related
- Venue account connection
- Demo runs
- Real funds runs
- Real trading safety
- Market data providers
- Execution journal: where every order event is recorded
Integrations
The venue Neurotrader trades at and the providers its market data comes from: what each supports and what it does not.
Market data providers
Reference for where Neurotrader's historical and live candles come from, at which intervals, with what coverage, and how the data reaches your computer.