Skip to Content
NeurotraderDocs
Integrations

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

AreaSupported
MarketSpot
EnvironmentsDemo Mode (practice funds) and the production exchange (real funds)
ModesLive Paper Trade in Demo Mode, Real Trade in production
AccountOne Binance account in each environment, each through its own stored credential
Algorithms per runOne. Several strategies run as one algorithm group
Key typeEd25519, self-generated. See Venue account connection
Market dataBinance'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 ModeProduction
Shown in the app asBinance Demo Mode, demo fundsBinance Live, real funds
Keys are made atdemo.binance.comwww.binance.com
FundsPractice funds, reset on Binance's Demo siteYour real balance
Trading rules and limitsThe same as productionBinance's
Safety rulesNoneReal 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:

CheckRefused when
CredentialNone is stored, it awaits its API key, it is not Ed25519, or it belongs to another environment
Key permissionsThe key cannot trade, or (production) the key can withdraw
InstrumentsAn instrument is not open for trading at Binance
Open ordersOrders are already open at Binance on the run's instruments
BalanceThe 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 NeurotraderOrder at Binance
MarketMARKET
LimitLIMIT
Stop marketSTOP_LOSS or TAKE_PROFIT, chosen by side and by where the trigger sits against the last price
Stop limitSTOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT, chosen the same way
Stop lossSTOP_LOSS
Take profitTAKE_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:

ValueRule
PriceNever moved. A limit or stop price off the tick grid is refused, because a moved price is a different order
QuantityRounded down to the step. Never rounded up
Too smallAn 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.

FilterLimits
PRICE_FILTERThe tick size and the allowed price range
LOT_SIZEThe quantity step, minimum and maximum
MARKET_LOT_SIZEThe largest single market order
NOTIONALThe smallest and largest order value
PERCENT_PRICE_BY_SIDEHow far from the market a price may sit
MAX_NUM_ORDERSOpen orders per instrument
MAX_NUM_ALGO_ORDERSOpen 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 BinanceIn Neurotrader
AcceptedOpen
Partly filledPartially filled, with one fill per trade
FilledFilled
CancelledCanceled, recorded when Binance confirms it, not when the cancel was requested
RejectedRejected, with Binance's reason
ExpiredExpired, with Binance's reason
Expired by self-trade preventionExpired, 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.

SubjectIn simulationAt Binance
Triggered stopsThe stop is retired and a new order carries the executionThe stop keeps its one order and reports its own fills
Stop orders per instrumentNo limitLimited by MAX_NUM_ALGO_ORDERS
Far-from-market limit ordersAcceptedCan be rejected by the price band
QuantitiesUsed as givenRounded down to the step
Your own orders crossingNot modelledBinance prevents the trade: the resting order expires and the incoming order goes on
FillsAgainst the candleBy Binance's order book, possibly in parts and at several prices
FeesThe maker and taker fees you setWhat Binance charges on each fill
BalanceThe starting balance you setThe 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:

LimitValue
Request weight6,000 per minute, per IP address
Orders100 per 10 seconds, per account
Orders200,000 per day, per account
Raw requests300,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

EventBehaviour
Binance closes the connection after 24 hours (scheduled)Reconnects before or when it happens, signs in again
The connection dropsReconnects with increasing waits, signs in again
After any reconnectAsks 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 errorTreats 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 outcomeRecorded as rejected, with the reason not accepted by the venue
Binance announces maintenanceReports it in Conditions and reconnects afterwards
The key is revoked or loses its permissionStops reconnecting. The run can no longer trade: stop it and check the account at Binance
The candle stream dropsReconnects 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 notReason
Borrow or trade on margin at BinanceVenue 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 ordersBinance spot has no such order, and a timer on your computer would only hold while the computer runs
Change an order in placeAn algorithm cancels and places again
Adopt orders that were already at BinanceThe algorithm does not know them. The start is refused instead
Reattach to orders after an ungraceful endThe record says what was outstanding, and you resolve it at Binance
Sell what the account held before the runClose closes only what the run's own fills built
Withdraw, deposit or transferNever needed. A production key that can withdraw is refused
Decide whether you may use BinanceEligibility is Binance's decision for your country and account
Hold your key on a serverThe key stays in your computer's key store, and orders go from your computer to Binance
Limit what an algorithm doesThe 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.

On this page