Traadence's Binance Order Flow Trading Bot is a BTC/USDT spot system built around live executed tape and top-of-book depth rather than candle-derived signals. It subscribes to Binance Spot WebSocket market streams for aggTrade and partial depth, reconstructs short-horizon order-flow state, records the same events for deterministic replay, and routes approved spot orders through Binance Spot REST trading endpoints. Binance documents aggTrade as real-time aggregated trade data for a single taker order. :contentReference[oaicite:0]{index=0}
The system is designed to answer one hard question: would this signal still make sense after spread, queue depth, partial fills, fees, and risk limits are applied?
Core Features
| Feature | Description |
|---|---|
| Tape + Depth20 ingestion | Dropped sockets and stale books corrupt microstructure signals. The feed layer maintains synchronized aggTrade and depth snapshots, applies reconnect/backoff logic, and records timestamped events for replay. |
| Aggressor-tagged CVD and imbalance | Directionless volume hides who crossed the spread. The signal engine tags taker-side flow, maintains cumulative volume delta, and measures bid/ask imbalance without putting an LLM in the decision path. |
| Absorption, sweeps, walls, voids, spoofs | Single prints are noisy and displayed liquidity can disappear. The engine scores repeated absorption, multi-level sweeps, liquidity walls/voids, and cancellation-heavy spoof candidates before allowing confluence. |
| Book-walking replay fills | Mid-price fills overstate execution quality. Replay walks recorded price levels until requested quantity is filled, charging spread, configured fees, and residual slippage at each consumed level. |
| Partial-fill accounting | All-or-nothing assumptions hide inventory and timing risk. The partial fill backtest simulator carries filled and unfilled quantity separately, then journals average execution price and remaining exposure. |
| Two-speed control loops | Slow signal evaluation can leave stops waiting. A fast event-driven reflex loop handles stops, targets, and kill conditions while a slower deterministic cadence evaluates new entries. |
| Hard risk caps and kill switch | A valid signal should not override account limits. The crypto trading bot with drawdown limit enforces position size, exposure caps, session drawdown thresholds, and a halt state before order submission. |
| Structured signal/fill journal | Post-mortems fail when signal context and execution are stored separately. The trading bot journal software writes signal features, decision reason, order request, fill fragments, costs, and post-trade outcome to one schema. |
Binance WebSocket Trading Bot Data Path
The binance websocket trading bot path is intentionally deterministic. aggTrade events update aggressor flow and CVD; depth updates refresh the visible book; a confluence layer evaluates absorption, sweeps, walls, voids, spoof candidates, and imbalance from the same event clock. The m field on Binance aggregate trades identifies whether the buyer was the market maker, which is useful for taker-side classification. :contentReference[oaicite:1]{index=1}
A practical order book imbalance trading bot cannot treat displayed size as truth in isolation. CME's Liquidity Tool tracks spread, book depth, and cost-to-trade together, while CME's 2025 liquidity research argues that depth alone can misrepresent liquidity. :contentReference[oaicite:2]{index=2} That is why the engine requires tape confirmation before a wall or void influences an entry.
Realistic Crypto Backtesting Software That Walks the Book
The realistic crypto backtesting software replays the exact recorder event stream instead of converting it into candles. When a marketable order is simulated, the fill model consumes available quantity level by level, computes volume-weighted execution price, adds the crossed spread and configured spot fee, and preserves any unfilled remainder. This makes slippage a function of recorded liquidity and requested size rather than a fixed percentage.
That methodology is deliberately stricter than bar-based testing. A candle can show that price traded through a level without proving the requested size was available there. Book walking exposes that difference, and repeated replay runs are deterministic so signal logic can be compared without random fill noise.
Crypto Spoof Detection Trading Bot Filters
A crypto spoof detection trading bot should not label every large cancellation as manipulation. The detector looks for unusually large displayed size, short resting time, repeated cancellation near touch, and whether executed tape confirms or contradicts the displayed interest. CFTC enforcement materials describe spoof orders as false supply-or-demand signals; that supports treating spoof output as a risk feature, not a standalone trade trigger. :contentReference[oaicite:3]{index=3}
The same caution applies to the absorption detector. Absorption requires aggressive volume repeatedly hitting a level without proportionate price progress, then confirmation from subsequent tape/depth behavior. Iceberg-like replenishment is flagged probabilistically because public top-of-book data cannot prove hidden quantity.
Crypto Market Microstructure Platform Tech Stack
| Component | Choice | Why it is used here |
|---|---|---|
| Runtime | Python asyncio | Python keeps the prototype maintainable; asyncio gives independent market-data, signal, risk, recorder, and execution tasks without putting model calls in the hot path. |
| Market data | Binance aggTrade + partial depth streams | Executed tape and visible depth arrive from the same venue and can be recorded as a replayable event sequence. |
| Execution | Signed Binance Spot REST orders | Live orders use the venue's documented spot trading endpoints, while pre-trade risk checks remain local. |
| Persistence | SQLite + append-only JSONL captures | SQLite keeps structured journals queryable; JSONL preserves raw event order for deterministic replay and failure investigation. |
| Optional review | Claude Messages API | Trade review is asynchronous and post-hoc only, so an external model cannot delay stops, targets, risk checks, or order routing. |
Use Cases
- Validate a BTC/USDT tape setup against recorded depth and see whether the entry survives spread, fee, slippage, and partial-fill accounting.
- Run discretionary order-flow ideas through deterministic CVD, imbalance, absorption, sweep, wall, void, and spoof rules before allowing live execution.
- Operate spot entries with fixed exposure limits while the faster reflex loop watches stops, targets, and the drawdown kill condition on every market event.
- Compare simulated fills with live fills using a common journal schema to isolate model error, latency, or liquidity changes instead of blaming the signal blindly.
Trading Bot Journal Software Project Directory
traadence-binance-orderflow/
├── pyproject.toml
├── .env.example
├── README.md
├── config/
│ ├── defaults.yaml
│ └── risk.yaml
├── src/
│ └── traadence_orderflow/
│ ├── main.py
│ ├── marketdata/
│ │ ├── binance_ws.py
│ │ ├── orderbook.py
│ │ ├── tape.py
│ │ └── recorder.py
│ ├── signals/
│ │ ├── cvd.py
│ │ ├── imbalance.py
│ │ ├── absorption.py
│ │ ├── sweeps.py
│ │ ├── spoof.py
│ │ └── confluence.py
│ ├── execution/
│ │ ├── binance_spot.py
│ │ ├── risk.py
│ │ ├── reflex.py
│ │ └── sizing.py
│ ├── replay/
│ │ ├── reader.py
│ │ ├── book_walk.py
│ │ ├── fill_model.py
│ │ └── metrics.py
│ ├── journal/
│ │ ├── events.py
│ │ └── sqlite_store.py
│ └── review/
│ └── claude_review.py
├── tests/
│ ├── test_reconnect.py
│ ├── test_book_walk.py
│ ├── test_partial_fills.py
│ ├── test_kill_switch.py
│ └── test_determinism.py
└── data/
└── .gitkeep
Realistic Crypto Backtesting Software Benchmarks
The acceptance checks measure execution fidelity, not profitability. Replay determinism requires the same capture to produce the same signals and fill sequence across 10 repeated runs. Reconnect testing forces a disconnect every 60 seconds for 100 cycles and verifies that recovery does not duplicate events or leave an unsynchronized local book.
Fill validation compares requested size, consumed depth, average execution price, fee, and residual quantity for every simulated order. Live-vs-replay review then measures execution-price difference in basis points by signal type; the result is diagnostic, not a promised threshold. Related trading bot customization and deployment and monitoring work can extend the same journal and risk controls without changing the signal methodology.
python -m traadence_orderflow.main replay --capture data/btcusdt-session.jsonl --report out/replay.json
python -m traadence_orderflow.main live --symbol BTCUSDT --config config/defaults.yaml
How to Trade Live Order Flow Using Traadence's Binance Order Flow Trading Bot
Download & Set Up the Project
Download, set up, and install Traadence's Binance Order Flow Trading Bot to get the project running. If you hit any difficulty, contact us here.
Open the Runtime
Start the CLI in replay or live mode, load the BTCUSDT configuration, and confirm tape, depth, journal, and risk services report healthy status.
Set Trading Parameters
Choose signal thresholds, order size, maximum exposure, session drawdown cap, fee assumptions, and replay capture. Keep spoof output as confluence rather than a standalone trigger.
Run and Review
Launch the session. The engine returns signals, orders, partial fills, post-cost P&L, hit rate by signal type, kill events, and a structured journal.
Questions
How does the simulator model slippage from recorded crypto order books?
It models slippage by walking the recorded ask or bid levels until the requested quantity is filled. Each consumed level contributes to the volume-weighted execution price, while spread, configured fees, and any unfilled remainder are recorded separately.
Why can a TradingView backtest diverge from live crypto fills?
A TradingView strategy backtest simulates orders from chart data, while this replay uses recorded trades and depth. :contentReference[oaicite:4]{index=4} Live fills also include spread, queue competition, partial fills, fees, and timing; those execution variables are preserved instead of assuming a single candle price.
How are partial fills represented during replay?
Every simulated order tracks requested quantity, filled quantity, residual quantity, consumed book levels, average fill price, and fees. If recorded depth cannot satisfy the full size, the remaining quantity stays unfilled rather than being invented at the last visible price.
Why separate stop and target handling from the signal loop?
Stops and kill conditions are latency-sensitive controls, while entry signals often need heavier feature calculations and confluence checks. Separating the loops lets risk react to each incoming market event without waiting for the slower signal cadence to finish.
How is WebSocket reconnect handling tested?
The test suite forces repeated disconnects, reconnects, and book resynchronization while checking event ordering and duplicate suppression. A recovered stream is accepted only after local depth is coherent again; signal generation is paused while the book state is uncertain.
