Skip to main content

Signal Brain

The Signal Brain is the directional intelligence layer that runs alongside the ladder bot. It does not place orders directly — it influences the ladder by adjusting spread multipliers, skewing order sizing, and setting directional bias on which side of the book to favour.

The brain runs on a continuous assessment cycle, aggregating 13 independent signal sources into a single directional output. Each signal votes independently. The aggregate determines how the ladder positions itself.


Architecture

The brain produces four outputs per cycle:

  • favor_sidelong, short, or neutral. The direction the aggregate signal is pointing
  • confidence — 0.0 to 1.0. How strongly the signals agree. High confidence = larger adjustments
  • size_multiplier — Scales order sizing on the favoured side. Above 1.0 = more size toward the signal
  • spread_multiplier — Adjusts spread on the unfavoured side. Above 1.0 = wider spread away from signal

A neutral brain means no adjustments — the ladder runs symmetrically. A high-confidence directional signal means tighter spread and larger size toward the signal, while widening the opposite side to reduce adverse fills.


The 13 Signal Sources

1. Value Area Position

Uses ExoCharts-sourced Value Areas (Point of Control, Value Area High, Value Area Low) for the current day, week, and month. Price position relative to these levels is the foundational context signal.

  • Price at VAL (Value Area Low): bullish bias — historical support, mean reversion probability elevated
  • Price at VAH (Value Area High): bearish bias — historical resistance
  • Price below VAL: moderate bullish bias — value area rejection, extended below fair value
  • Price above VAH: moderate bearish bias — extended above fair value
  • Price inside VA: neutral — at fair value, no strong positional bias

Weekly and monthly value areas carry higher weight than daily. Price at weekly VAL during a daily at VAL is a compound signal.

2. Value Area Rejection

Detects multi-touch rejection patterns at VAH or VAL levels in real time. A single touch of VAL is noted. Three touches without a break is a rejection pattern — the level is being defended. This converts a moderate positional signal into a strong one.

Rejection patterns decay over time and reset on a level break.

3. Liquidation Proximity

Monitors the distance between current price and known liquidation clusters, sourced from the CloudFront aggregation feed and updated continuously.

The logic: large liquidation clusters are liquidity magnets. Price moves toward clusters as they are hunted. When price is within proximity of a significant short liquidation cluster, the signal is bullish — a cascade of forced buys is probable. Long liquidation proximity signals bearish — forced sells incoming.

This signal is one of the most reliable in the set because liquidation levels are structural facts derived from exchange data, not an indicator constructed from price.

4. CVD Divergence

Measures the divergence between spot CVD (Cumulative Volume Delta on spot markets) and perpetual CVD on the same asset. CVD tracks net aggressive buying minus aggressive selling.

The signal: when spot CVD is rising but perpetual CVD is falling, futures traders are distributing while spot buyers accumulate. This pattern precedes squeeze events. When the divergence is sustained and significant, the signal is directional — the side with stronger spot-driven flow is likely to win.

Data is aggregated from Binance Futures, Binance Spot, Bybit, and Coinbase in real time via WebSocket feeds.

5. Sustained Taker Aggression

Tracks the rolling distribution of taker delta (aggressive buy volume minus aggressive sell volume) over a configurable lookback window. The signal fires when taker aggression on one side has been elevated for a sustained period — not a single spike, but persistent imbalance.

Single spikes in taker delta are noise. Sustained aggression over 20+ consecutive readings represents informed flow rather than a random institutional order.

6. Range Position

Monitors where price sits within its recent trading range, calculated from the bot's own price history. Buying at the bottom of a range and selling at the top is standard mean-reversion logic. The signal adjusts the ladder's positioning to lean into range extremes.

This signal is subordinate to value area position — if VA signals are strong, range position is downweighted.

7. Instant Taker Bias

A faster version of sustained taker aggression. Uses the aggregated order book imbalance (OBI) and very recent taker delta (last 30–60 seconds) to detect the current momentum of flow. This signal has a short half-life — it moves the ladder for the current cycle, not the next several cycles.

8. Funding Rate Trend

Monitors perpetual funding rate trend across the last three readings. Funding rate is the market's continuous signal of leverage positioning. Sustained positive funding means longs are crowded and paying shorts; sustained negative means shorts are crowded.

The brain uses funding trend rather than funding level — a rate moving from +0.01% to +0.03% to +0.05% carries a different signal than a static +0.05%. The trend indicates whether positioning imbalance is building or normalising.

9. Seasonality

Time-of-day and time-of-week patterns identified from historical fill data. Crypto markets have well-documented session effects: Asian session, London open, New York open each produce distinct liquidity and directional characteristics.

The seasonality signal is a prior — it adjusts the prior probability of the brain's direction before other signals are layered in. On its own it is weak. In combination with confirming signals, it tips borderline confidence scores toward a decision.

10. ML Ensemble

Three pre-trained XGBoost models, each trained on a different feature set derived from OHLCV data, taker flow, and orderbook features. The models are trained using CPCV on 365 days of historical data with RFECV (Recursive Feature Elimination with Cross-Validation) to prevent overfitting.

Each model produces an independent directional probability. The ensemble signal is the agreement score — when all three agree, the signal is strong; when they disagree, the signal is suppressed.

Models are loaded at startup and do not update during a live session. The ensemble requires a 200-bar OHLCV buffer (approximately 50 hours at 15-minute bars) to begin producing output — before that, the ensemble voter is dormant.

11. Volatility Phase

Classifies the current volatility regime as low, normal, or elevated using realised volatility from the shared market data feed with a Binance REST fallback. The primary use is as a modulator rather than a directional signal: high volatility narrows all spread multipliers (less aggressive adjustment, more symmetric behaviour); low volatility allows wider directional tilts.

12. Squeeze Detector

Detects squeeze conditions using spot CVD, perpetual CVD, and the current delta in combination.

  • Spot CVD rising + perp CVD falling + negative delta → short squeeze setup → bullish signal
  • Spot CVD falling + perp CVD rising + positive delta → long squeeze setup → bearish signal

A short squeeze occurs when price rises and forces short sellers to cover, creating a self-reinforcing buy cascade. The squeeze detector identifies the setup phase before the cascade begins.

13. Hurst Exponent

The Hurst exponent measures whether price is trending (H > 0.5), mean-reverting (H < 0.5), or random walking (H ≈ 0.5). It is calculated from the bot's rolling price history using rescaled range analysis.

In a trending regime (H > 0.6), directional signals are upweighted — momentum is likely to continue. In a mean-reverting regime (H < 0.4), directional signals are downweighted and contrarian — a move up is more likely to reverse. The Hurst exponent provides the regime context that makes other signals more or less actionable.


Signal Aggregation

Signals are aggregated by weighted vote. Each signal produces a directional score between -1.0 (bearish) and +1.0 (bullish). Weights are market-specific — the weighting reflects which signals have historically been most predictive for that market.

The aggregate confidence score determines whether the brain applies any adjustment at all. Below a minimum confidence threshold, the brain outputs neutral regardless of the direction of the aggregate. This prevents low-conviction mixed signals from generating noise adjustments.


Data Sources

Signal GroupData Source
Value Areasdata/value_areas/exocharts_value_areas.yaml — manually seeded from ExoCharts for BTC/ETH/SOL/HYPE; auto-calculated for others
CVD, Taker, OBIdata/shared_market_data.json — written by the data collector, read by the brain every cycle
Liquidation levelsdata/liquidation_levels.json — sourced from CloudFront aggregation feed
ML Ensemble modelsPre-trained .pkl files loaded at startup
Hurst, RangeDerived from runtime price history accumulated during the session
Fundingadvanced/funding_analyzer.py — polls exchange funding API on a configurable interval
Seasonalityadvanced/seasonality_engine.py — historical session patterns
Squeezeadvanced/squeeze_detector.py — real-time CVD divergence detection

Adaptive Trade Learning

On top of the 13 signal voters, the brain runs a continuous learning layer that observes the outcome of every trade and adjusts signal weights over time.

Every time a position opens, the system snapshots which signals were active and what they were saying. When the position closes, it records whether the trade was profitable and by how much. Over hundreds of trades, patterns emerge: certain signals predict well in certain market conditions, others consistently lead to losses.

The system classifies each signal pattern into one of three states:

  • Promoted - consistently profitable, high salience score. These signals get their brain weight boosted up to 1.5x their baseline.
  • Active - still accumulating data or performing at baseline. No adjustment.
  • Archived - consistently unprofitable or degrading. These signals get their weight reduced to 0.5x baseline, dampening their influence on the brain's output.

This means two identical bots running on two different markets will gradually develop different signal weightings. A bot on BTC where OBI bearish signals have a 65% win rate will upweight OBI. A bot on SOL where CVD divergence is the strongest predictor will upweight CVD instead. The brain adapts to what actually works per market rather than using the same static weights everywhere.

Trade learning requires a minimum of 20 completed trades before it begins adjusting weights. Below that threshold, the brain uses its default market-specific weights. The learning data persists across bot restarts so progress is never lost.


Enabling the Brain

The brain is activated with the --brain flag when starting the ladder bot. It runs in the same process and adds no external dependencies beyond the data files listed above.

Value area data must be current for VA signals to be accurate. If you are running on a market that is not in the value area YAML, VA and VA rejection signals will be dormant. All other signals remain active.