User Guide

Vantedge BookPilot

BookPilot watches the Level 2 order book (market depth) tick by tick. It has two signal engines. Pressure Break fires when the resting size on one side of the book outweighs the other side and the imbalance holds. Pulled Wall fires when a large resting order (a wall) near price gets pulled without trading, which suggests it was there to mislead. A short-term forecast can confirm each signal, and Rules of Engagement plus daily limits decide whether it may trade. Entries are limit orders just behind the best bid or ask, with a fixed bracket.

Platform
NinjaTrader 8, ES and NQ (micros with adjusted $ brackets)
Data needed
Level 2 market depth, live or Market Replay
Backtesting
No. It runs in real time and Market Replay only. The Strategy Analyzer gives no trades
Entries
Limit orders behind the touch, with a timeout and a run-away cancel

What BookPilot does

Most order flow tools look at trades that already happened. BookPilot looks at the resting orders that have not traded yet: the size waiting on the bid and on the ask, level by level. It reacts within milliseconds when that book becomes lopsided or when large orders disappear.

Pressure Break adds up the size on the first Pressure Break Depth levels of each side. When the bid side is at least Pressure Break Ratio times the ask side, a long candidate starts (a short candidate when the ask side is heavier). The signal fires if the ratio stays at or above Pressure Break Hold Ratio for Confirm (ms). It then does not fire again until the ratio drops back below the hold ratio.

Pulled Wall looks for a level whose size is at least Pulled Wall Ratio times the average of the levels behind it. It follows that wall as price approaches. If most of the wall is removed without trading, BookPilot gives it a spoof probability. Above Fire Probability it trades against the wall: a pulled bid wall means sell and a pulled ask wall means buy.

From signal to order

  1. A scanner fires. Each scanner then rests for 5 seconds. If both scanners fire in opposite directions at the same moment, there is no trade.
  2. A Pressure Break is vetoed while the book's spoof score is 0.6 or higher, because the pressure is probably fake.
  3. With Forecast Confirm on, the micro-forecast has to give the signal's direction at least Confirm Threshold probability, and at least Confirm Min Vectors trend vectors have to agree.
  4. Rules of Engagement check the signal: the strategy has to be armed and flat, inside the trading hours, allowed by the ROE mode (With Bias, Long only or Short only) and under the risk preset's hourly trade limit.
  5. BookPilot places a limit order a few ticks behind the best bid (long) or best ask (short). The order is cancelled if it has not filled within Entry Timeout or if price runs away by the Cancel ticks.
  6. Once filled, the profit target and stop are live. Break-even and the Risk Tolerance early exit are optional. After a losing trade, the risk preset's cooldown runs before BookPilot re-arms.

The micro-forecast and bias

The forecast estimates the probability that the next 2-tick move of the mid price is up (P up). It is built from queue imbalance at the touch, microprice offset, the buy/sell balance of the last Flow Window prints and the Pressure Break ratio. It starts with built-in weights and learns from your instrument: after about 1,600 labelled samples it fits its own model and refits every 200 new samples.

The learned model is saved per instrument when the strategy stops, in Documents\NinjaTrader 8\VantedgeAlpha\forecast_<instrument>.txt. To make BookPilot start learning from scratch, delete that file.

The Microstructure Bias is Long when P up is at or above Bias Threshold, Short when P up is at or below 1 - Bias Threshold, and None in between. In With Bias mode, signals against the bias are refused. When the bias is None, signals in both directions pass.

First run, step by step

  1. Install the package with Install.ps1 -Clean and compile in NinjaTrader (New > NinjaScript Editor > F5).
  2. Make sure your data feed provides Level 2 market depth. For Market Replay, download replay data for the instrument (Tools > Historical Data > Load > Market Replay), which includes depth.
  3. Open a chart of the instrument (ES or NQ) and open its Chart Trader (right-click the chart > Chart Trader).
  4. Add the strategy: right-click the chart > Strategies > Vantedge BookPilot. Paste your licence key, choose Sim101 and enable it.
  5. Read the NinjaScript Output window. It prints the bracket in ticks for your instrument, for example 150 $ target = 30 ticks on NQ.
  6. On the panel, press With Bias to arm. If no depth has arrived in the last 5 seconds, BookPilot refuses to arm and says why.
  7. Let it run in SIM or Market Replay for several sessions. The panel's Blocked line shows why each signal was not traded.

Daily routine

  • Before the open: check Daily Profit Goal, Daily Max Loss, the risk preset and the trading hours.
  • Arm with With Bias, Engage Long or Engage Short. Pressing the active button again disarms.
  • Auto Re-Arm on: BookPilot arms itself again after every trade (after the cooldown when the trade lost). Off: it disarms after each trade.
  • Flatten All cancels the working entry and exits the position immediately.
  • When the goal or the max loss is reached, BookPilot locks until the next session. Open positions are closed 30 seconds before the session ends.

Chart Trader panel

ButtonWhat it does
With BiasArm and only take signals that agree with the Microstructure Bias, or any signal while the bias is None.
Engage Long / Engage ShortArm for one direction only. Press again to disarm.
Auto Re-ArmSwitch automatic re-arming after each trade on or off.
Pulled Wall / Pressure BreakSwitch each signal engine on or off while running.
DEX-ArrayComing soon (inactive).
LOW / MEDIUM / HIGHRisk preset: quantity, hourly trade cap and cooldown after a loss (see the Risk Preset row below).
Forecast ConfirmSwitch the forecast confirmation filter on or off.
Flatten AllCancel the working entry and close the position at market.

Settings reference

Every setting, and what changing it does

Settings are listed in the order and groups NinjaTrader shows in the strategy dialog. The suggested range is a starting point for testing on SIM or Market Replay, not a guarantee of results.

Vantedge License

Licensing only. These settings do not change how the strategy trades.

License Key

Default
(empty)
Allowed
Your key
Suggested
Your key

The licence key from your purchase email. Without a valid key the strategy does not arm.

API URL

Default
https://license.vantedgealpha.com
Allowed
-
Suggested
Do not change

The licensing server. Only change it if support asks you to.

ROE

Rules of Engagement: when BookPilot is allowed to trade, how big and how often.

Rules of Engagement

Default
With Bias
Allowed
With Bias, Long Only, Short Only
Suggested
With Bias

The mode used by Arm On Start. The panel buttons choose the mode while the strategy runs.

Auto Re-Arm

Default
On
Allowed
On / Off
Suggested
On for hands-off running, Off to approve each trade

Re-arm automatically after a trade or after a cooldown.

Increase / On

On: continuous trading until a gate stops it.

Decrease / Off

Off: one trade, then you arm again by hand.

Risk Preset

Default
Medium
Allowed
Low, Medium, High
Suggested
Low while testing, then Medium

LOW: 1 contract, at most 10 trades per hour, 60 s cooldown after a loss. MEDIUM: half of Order Qty (minimum 1), 20 trades per hour, 20 s cooldown. HIGH: full Order Qty, no hourly cap, 5 s cooldown.

Increase / On

Towards HIGH: more size, more trades and faster re-entry after losses.

Decrease / Off

Towards LOW: 1 contract, fewer trades and longer pauses after a loss.

Order Qty (base)

Default
1
Allowed
1 - 1000
Suggested
Size so that one stop is no more than 1/3 of Daily Max Loss

The base contract count. LOW always trades 1, MEDIUM trades half of it (rounded down, at least 1) and HIGH trades all of it. For 2 contracts on MEDIUM, set 4.

Increase / On

Bigger positions, with profit and loss scaling in step. The daily limits are reached after fewer trades.

Decrease / Off

Smaller positions.

Daily Profit Goal ($)

Default
2500
Allowed
Greater than 0
Suggested
2 - 4 x Daily Max Loss

The realised profit at which BookPilot locks for the session. Do not set it to 0: 0 does not switch it off, it locks after the first trade that is not a loss.

Increase / On

Keeps trading longer on good days.

Decrease / Off

Locks in good days sooner.

Daily Max Loss ($)

Default
750
Allowed
Greater than 0
Suggested
Below your prop firm's daily loss limit, minus at least one full stop

The realised loss at which BookPilot locks for the session. It counts closed trades, so the last trade can go past it by up to one stop. Do not set it to 0.

Increase / On

More room on a bad day, with a bigger worst-case loss.

Decrease / Off

Stops sooner on a bad day. If it is set too tight, normal losing streaks end the day early.

Use Trading Hours

Default
On
Allowed
On / Off
Suggested
On

Only take new entries between Start Time and End Time. It never closes an open position.

Increase / On

On: trades only in the window.

Decrease / Off

Off: trades any time the session is open, including thin overnight books.

Start Time (HHmmss, exchange time)

Default
083000
Allowed
000000 - 235959
Suggested
083000 - 090000 (CME exchange time is Chicago)

The start of the trading window, in exchange time. 083000 is the US cash open.

Increase / On

Later: skips the opening volatility.

Decrease / Off

Earlier: includes pre-open trading, when books are thinner.

End Time (HHmmss, exchange time)

Default
150000
Allowed
000000 - 235959
Suggested
110000 - 150000

The end of the trading window. If it is earlier than Start Time, the window runs overnight.

Increase / On

Later: includes the afternoon session.

Decrease / Off

Earlier: morning only, often the cleanest two-sided book.

Arm On Start

Default
Off
Allowed
On / Off
Suggested
Off (On only when the Chart Trader panel is not available)

Arms automatically in the Rules of Engagement mode as soon as Level 2 data is live.

Increase / On

On: starts trading without a click.

Decrease / Off

Off: you arm from the panel.

Risk Tolerance

Default
High
Allowed
Low, Medium, High
Suggested
High or Medium

Early exit policy. High: never exits early, only the bracket closes the trade. Low: exits when the forecast for your position falls below the threshold, or (Pressure Break trades only) when the spoof score rises above 1 - threshold. Medium: the same as Low, but only while the trade is losing.

Increase / On

Towards High: trades get their full bracket, with fewer scratches and full stops more often.

Decrease / Off

Towards Low: more early exits. Losses are cut sooner, but some winners are cut too.

Risk Tolerance Threshold

Default
0.40
Allowed
0.0 - 1.0
Suggested
0.35 - 0.45 (keep it below 0.5)

With Risk Tolerance Low or Medium: exit when the forecast probability for the position falls below this value, or the spoof score rises above 1 minus this value.

Increase / On

Exits sooner. At 0.5 or higher it exits on almost any wobble.

Decrease / Off

Exits only on clear deterioration.

Orders

How entries are placed and how the bracket is sized. Tick value per contract: ES $12.50, NQ $5.00, MES $1.25, MNQ $0.50.

Use Limit Orders

Default
On
Allowed
On / Off
Suggested
On

On: limit entries behind the touch, with the timeout and run-away cancel. Off: market entries (always filled, but with slippage, and the timeout and cancel settings do nothing).

Increase / On

On: better prices, but some signals go unfilled.

Decrease / Off

Off: every signal is filled, at a worse price.

Entry Timeout (ms)

Default
3000
Allowed
100 - 600000
Suggested
1000 - 5000

How long an unfilled limit entry stays working before it is cancelled.

Increase / On

More fills, but more of them come late, after the edge is gone.

Decrease / Off

Only fresh fills, and more missed trades.

Brackets in $ per Contract

Default
On
Allowed
On / Off
Suggested
On

On: the target and stop come from the two $ amounts below, converted to ticks for the instrument, and the per-engine tick settings are ignored. Off: the Pressure Break and Pulled Wall tick settings are used.

Profit Target ($ per contract)

Default
150
Allowed
1 - 100000
Suggested
NQ 100 - 200, ES 100 - 200, micros 10 - 20

The target in dollars per contract. NQ: 150 $ = 30 ticks. ES: 150 $ = 12 ticks. On micros the same amount is 10 times further away (MNQ: 150 $ = 300 ticks), so lower it.

Increase / On

Bigger winners and a lower hit rate.

Decrease / Off

A higher hit rate with smaller winners.

Stop Loss ($ per contract)

Default
100
Allowed
1 - 100000
Suggested
NQ 75 - 150, ES 75 - 150, micros 7.5 - 15

The stop in dollars per contract. NQ: 100 $ = 20 ticks. ES: 100 $ = 8 ticks.

Increase / On

Fewer noise stop-outs, but bigger losses.

Decrease / Off

Smaller losses, and more trades stopped before they work.

Pressure Break Target / Stop (ticks)

Default
30 / 20
Allowed
1 - 1000
Suggested
NQ 20 - 40 / 12 - 30, ES 8 - 16 / 6 - 12

The bracket for Pressure Break trades. Only used when Brackets in $ per Contract is off.

Increase / On

Wider bracket: bigger wins and losses, and fewer trades resolved quickly.

Decrease / Off

Tighter bracket: quicker, smaller outcomes.

Pressure Break Limit Offset (ticks)

Default
2
Allowed
0 - 100
Suggested
0 - 3

How many ticks behind the best bid (long) or best ask (short) the entry is placed. 0 joins the touch.

Increase / On

A better price but fewer fills. The fills you do get tend to be the trades going against you.

Decrease / Off

More fills, closer to the signal price.

Pressure Break Cancel (ticks)

Default
4
Allowed
1 - 100
Suggested
2 - 6

Cancel the unfilled entry when price moves this many ticks away in the trade's direction.

Increase / On

The order is kept longer while price runs.

Decrease / Off

Gives up quickly when the move leaves without you.

Pulled Wall Target / Stop (ticks)

Default
30 / 20
Allowed
1 - 1000
Suggested
NQ 20 - 40 / 12 - 30, ES 8 - 16 / 6 - 12

The bracket for Pulled Wall trades. Only used when Brackets in $ per Contract is off.

Increase / On

Wider bracket.

Decrease / Off

Tighter bracket.

Pulled Wall Limit Offset (ticks)

Default
1
Allowed
0 - 100
Suggested
0 - 2

The entry offset behind the touch for Pulled Wall trades.

Increase / On

A better price but fewer fills.

Decrease / Off

More fills.

Pulled Wall Cancel (ticks)

Default
3
Allowed
1 - 100
Suggested
2 - 5

The run-away cancel distance for Pulled Wall entries.

Increase / On

Keeps the order longer.

Decrease / Off

Cancels sooner.

Break-Even Trigger (ticks)

Default
0 (off)
Allowed
0 - 100
Suggested
0, or 50 - 70% of the target in ticks

Once the trade is this many ticks in profit, the stop moves to the entry price plus the offset. This happens once per position.

Increase / On

Protects later, so more full losses are possible.

Decrease / Off

Protects earlier, so more trades end at break-even.

Break-Even Offset (ticks)

Default
0
Allowed
0 - 100
Suggested
0 - 2

How many ticks beyond the entry the break-even stop is placed, on the profit side.

Increase / On

Covers commission, but the stop is hit more easily.

Decrease / Off

0 is a true break-even.

Scanner – Pressure Break

The book-pressure signal.

Use Pressure Break Scanner

Default
On
Allowed
On / Off
Suggested
On

Turns the engine on or off. The panel button does the same while running.

Pressure Break Depth

Default
2
Allowed
1 - 10
Suggested
1 - 5

How many book levels per side are added up. 1 means only the best bid and best ask.

Increase / On

Looks at deeper liquidity. It is steadier but slower, and more of the size it sees can be pulled before price gets there.

Decrease / Off

Focuses on the touch. It is faster and more sensitive, and noisier.

Pressure Break Ratio

Default
4.0
Allowed
1.0 - 50.0
Suggested
3.0 - 6.0

How many times heavier one side has to be to start a candidate.

Increase / On

Only extreme imbalances count, so fewer and stronger signals.

Decrease / Off

More signals. Below about 2.5 it fires on ordinary book noise.

Pressure Break Hold Ratio

Default
2.5
Allowed
1.0 - 50.0
Suggested
2.0 - 3.5 (at most Pressure Break Ratio)

The candidate has to stay at or above this ratio for the confirm time. After firing, the scanner waits until the ratio drops below it.

Increase / On

The pressure has to hold more firmly, so fewer confirmations.

Decrease / Off

Confirms more easily, including pressure that is fading.

Confirm (ms)

Default
250
Allowed
0 - 10000 (capped at 2499)
Suggested
100 - 1000

How long the pressure has to hold before the signal fires.

Increase / On

Fewer quick fakes, but a later entry.

Decrease / Off

Earlier entries, and more flickering imbalances get through.

Invert (λ/Φ)

Default
Off
Allowed
On / Off
Suggested
Off

Flips the Pressure Break direction, so a heavy bid becomes a short signal. Use it only if your testing shows the pressure being faded on your market.

Increase / On

On: trades against the pressure.

Decrease / Off

Off: trades with the pressure.

Scanner – Pulled Wall

The pulled-wall (spoof fade) signal. Book levels are counted from the inside: the best bid or ask is depth 0 for Start and Split Depth, and depth 1 for Pulled Wall Depth.

Use Pulled Wall Scanner

Default
On
Allowed
On / Off
Suggested
On

Turns the engine on or off. The panel button does the same while running.

Pulled Wall Depth (inside = 1)

Default
4
Allowed
1 - 10
Suggested
3 - 6

The deepest level that is scanned for walls. Together with Start Depth it sets the scan band (by default the 3rd and 4th levels). It must be greater than Start Depth, or nothing is scanned.

Increase / On

Finds walls further from price. More walls are found, and they are more often harmless.

Decrease / Off

Only walls near the touch.

Pulled Wall Start Depth (inside = 0)

Default
2
Allowed
0 - 9
Suggested
1 - 3

The first level scanned for walls. 0 includes the best bid or ask.

Increase / On

Ignores levels near the touch, where size changes all the time.

Decrease / Off

Includes the touch, so more walls and more noise.

Pulled Wall Split Depth (inside = 0)

Default
2
Allowed
0 - 9
Suggested
1 - 3

The average size of the levels from here out to the 10th level is the baseline a wall is compared with.

Increase / On

The baseline uses deeper levels only, which are often larger, so fewer walls qualify.

Decrease / Off

The baseline includes the thinner levels near the touch, so more walls qualify.

Pulled Wall Ratio

Default
2.2
Allowed
1.0 - 50.0
Suggested
2.0 - 4.0

How many times the baseline a level's size has to be to count as a wall.

Increase / On

Only big walls are tracked, so fewer and more meaningful signals.

Decrease / Off

Ordinary size bumps count as walls, so more signals and more noise.

Approach (ticks)

Default
2
Allowed
0 - 20
Suggested
1 - 4

Price within this many ticks of the wall counts as approached. An approached wall that is pulled scores higher (+0.20).

Increase / On

Walls count as approached from further away, so signals reach Fire Probability more easily.

Decrease / Off

Only walls that price really reaches get the bonus.

Pull Fraction

Default
0.6
Allowed
0.05 - 1.0
Suggested
0.5 - 0.8

The share of the wall's peak size that has to disappear without trading to count as a pull.

Increase / On

Only near-complete pulls count, so fewer and cleaner signals.

Decrease / Off

Partial reductions count, so more signals, including normal order management.

Max Wall Age (ms)

Default
30000
Allowed
100 - 600000
Suggested
10000 - 60000

A wall that has been tracked longer than this is dropped.

Increase / On

Long-standing walls stay tracked, which catches slow spoofs.

Decrease / Off

Only recent walls are tracked. Young walls already score higher.

Fire Probability

Default
0.6
Allowed
0.0 - 1.0
Suggested
0.55 - 0.75

The minimum spoof probability of a pulled wall to trade. The score is 0.35 base, +0.20 if approached, +0.15 for a short life (under 5 s), +0.15 for frequent size changes and +0.15 for opposite aggressive volume.

Increase / On

Only the most spoof-like pulls trade, so fewer trades.

Decrease / Off

More pulls trade. At 0.55 or lower, any approached pull qualifies.

Forecast

The micro-forecast and the confirmation filter.

Bias Threshold

Default
0.55
Allowed
0.5 - 1.0
Suggested
0.52 - 0.65

P up at or above this value gives a Long bias, and at or below 1 minus this value a Short bias. With Bias mode refuses signals against the bias.

Increase / On

The bias is None more often, so With Bias blocks fewer signals and more trades get through.

Decrease / Off

There is almost always a bias, so With Bias blocks more signals.

Flow Window (prints)

Default
50
Allowed
1 - 512
Suggested
20 - 150

The number of recent trades in the forecast's buy/sell flow input. After changing it, delete the saved forecast file so the model relearns with the new window.

Increase / On

The flow input is smoother but slower.

Decrease / Off

The flow input reacts fast but is noisier.

Forecast Confirm

Default
On
Allowed
On / Off
Suggested
On

Signals have to be confirmed by the forecast and the trend vectors (see the next two settings). The panel button does the same while running.

Increase / On

On: fewer trades, with the forecast agreeing.

Decrease / Off

Off: every signal that passes the ROE is traded. Pulled Wall can then fade the pressure.

Confirm Threshold

Default
0.55
Allowed
0.5 - 1.0
Suggested
0.52 - 0.65

With Forecast Confirm on, the forecast has to give the signal's direction at least this probability.

Increase / On

Stricter, so fewer trades with stronger agreement. Above about 0.7 trades become rare.

Decrease / Off

Looser. 0.5 makes the forecast filter almost neutral.

Confirm Min Vectors

Default
0 (off)
Allowed
0 - 4
Suggested
0 - 2

With Forecast Confirm on, how many of the 4 trend vectors (mid-price slope over the last 5, 20, 40 and 150 price changes) have to point the signal's way.

Increase / On

Only trades in line with the short-term trend.

Decrease / Off

Allows counter-trend signals.

Starting profiles

Three starting profiles. Balanced uses the shipped defaults. Use them as a starting point for your own testing, not as a promise of results.

SettingConservativeBalancedActive
Risk PresetLowMediumHigh
Pressure Break Ratio5.04.03.0
Confirm (ms)500250150
Pulled Wall Ratio3.02.22.0
Fire Probability0.700.600.55
Confirm Threshold0.600.550.52
Risk ToleranceMediumHighHigh
End Time110000150000150000

How to optimize

  1. BookPilot cannot be optimised in the Strategy Analyzer because historical bars carry no order book. Tune it in Market Replay: download several days with Level 2 and replay the same days after each change.
  2. Change one setting at a time and write down the trade count, win rate, average win and loss, and the reasons on the panel's Blocked line.
  3. If the panel mostly shows Blocked: Forecast Confirm or against the bias, the filters are strict. Lower Confirm Threshold or raise Bias Threshold a little. If many trades lose straight away, tighten the scanners (higher ratios, a longer Confirm).
  4. Many cancelled entries (timeout or run-away) mean the limit offset is too deep or the timeout too short. Many entries filled and then stopped quickly suggest the offset is too deep (you only get filled when wrong) or Confirm is too short.
  5. The forecast learns per instrument. Let it collect a few sessions of data before judging Forecast Confirm, and keep the forecast file when you change only trading settings.
  6. Replay rewinds and jumps reset cooldowns and the hourly trade count, so time your evaluations from continuous replay.

Built-in rules you cannot change

  • Each scanner waits 5 seconds after it fires.
  • A Pressure Break is vetoed while the book spoof score is 0.6 or higher.
  • BookPilot refuses to arm if no Level 2 update arrived in the last 5 seconds.
  • One position at a time, and positions are closed 30 seconds before the session ends.
  • A rejected order stops the strategy (NinjaTrader's Stop, cancel and close handling).

Troubleshooting

ProblemFix
"cannot arm -- no Level 2 data in the last 5 s"Your feed has no market depth for this instrument, or replay is paused. Check that the SuperDOM shows several levels.
No trades in the Strategy AnalyzerThis is expected. BookPilot only trades in real time and in Market Replay.
Signals appear but no ordersRead the Blocked line on the panel: not armed, outside the trading window, against the bias, hourly limit or forecast confirm.
Target or stop looks far too wide on MNQ or MES$ brackets are per contract, and micros are worth 1/10. Use for example 15 $ / 10 $, or switch to tick brackets.
Locked right after the first tradeDaily Profit Goal or Daily Max Loss is set to 0. Set both to real amounts.

Futures trading involves substantial risk of loss. Settings and ranges in this guide are starting points for your own testing and are not a promise of results. Run every change on SIM or Market Replay before a funded or live account. See the risk disclaimer.