Delta Footprint Chart
- 지표
-
Yuxin Lyu
I build chart and volume tools for MetaTrader 5 — session volume profiles, order-flow style strength visuals, and lightweight manual trading panels. - 버전: 1.12
- 업데이트됨: 5 11월 2026
- 활성화: 10
Overview
Delta Footprint Chart is a Canvas-based footprint chart indicator for MetaTrader 5. It renders self-drawn candles, numeric Buy×Sell footprint ladders, cumulative volume delta (CVD), and a selected-bar inspector — all on a single bitmap overlay. No chart objects, no buffer plots, no layered windows.
Data Source & Honest Limits
Order-flow style views are built from your broker ticks ( CopyTicks / range APIs). Aggressor side uses AggressorRule_v1. A tick takes the Trade path only when it simultaneously carries Last, volume, and TICK_FLAG_BUY or TICK_FLAG_SELL . Otherwise the quote path synthesizes direction from bid/ask/last movement. The data source chip (amber = Synthetic, green = Trade, blue = Mix) on the toolbar tells you which path produced the numbers.
- Not exchange Level 2
- Not a full-market tape
- Not institutional order flow
This is an honest synthetic footprint for FX/CFD traders — never marketed as exchange depth.
Main Features
- Footprint ladders — Inside each candle, every price row displays Bid volume (left) and Ask volume (right). Cell heat maps relative volume intensity. When the cell is wide enough, full Ask×Bid digits appear; when narrower, a signed Delta; when too small, a colored glyph.
- Imbalance & Stacked levels — Rows where one side dominates by a configurable ratio (default 3:1) are highlighted. Consecutive imbalanced rows in the same direction get a stack marker — a visual cue for absorption or exhaustion.
- POC (Point of Control) — The price row with the highest total volume in each bar is marked with an amber bar.
- CVD strip — A resizable cumulative volume delta curve below the chart, scaled to the visible window. Optional delta histogram and a three-row data table (Volume / Delta / Cumulative) aligned under each bar.
- CVD Divergence — Optional yellow circles marking bars where close and CVD moved in opposite directions — a neutral observation, not a trade signal.
- Inspector panel — Right-side table showing the selected bar's OHLC, total Ask/Bid/Delta, POC price, tick breakdown (trade vs. quote vs. neutral vs. ignored), and a scrollable price-level ladder.
- Delta table — Per-bar Volume, Delta, and Cumulative Delta values in a compact strip beneath the CVD curve.
- Independent viewport — Wheel zoom, Shift+Left pan (time + price), price-axis drag to scale. Bars can widen up to 280px each.
- Instrument presets — One-tick switch between Gold / FX / Index profiles (row size, spread cap, CVD height, colors).
- Performance presets — Balanced / Gold / Lite / Manual — tune CPU vs. history depth.
- Bilingual UI — English / Chinese toolbar, inspector, and labels.
How to Install & Use
- In MetaTrader 5 → Navigator → Indicators → open DeltaFootprintChart (or drag it onto a chart).
- Start with XAUUSD M5 (or your liquid symbol) during market hours so tick ladders fill.
- On first attach, leave most defaults. Set Language to English or Chinese, and pick an InstrumentPreset if you want a one-click Gold/FX/Index start.
- Click OK. Wait for the first tick rebuild (history depth = HistoryBarsTarget).
- Use the mouse wheel to zoom until Bid×Ask digits are readable. If digits stay hidden, raise MaxPxPerBar or zoom further.
- Click a candle to pin the inspector. Use toolbar chips for CVD / Inspector / Imbalance / instrument switching.
- Empty ladders when the market is closed (no ticks) are normal — wait for live ticks.
Chart Controls (After Attach)
- Wheel — Zoom bars (px/bar). Digits appear only when bar width and cell height pass the thresholds.
- Shift + Left-drag — Pan time and price together; any pan clears Follow-last-bar.
- Left-drag on price axis — Scale the price span (native MT5 feel). Row height and digit font follow.
- Plain left-drag on chart — Free for MT5 objects (rectangle, etc.); pan is Shift+Left.
- Double-click price axis or plot, F, or toolbar Fit — Fit visible high/low.
- Home — Follow latest bar and fit price.
- [ / ] — Move inspector to older / newer bar. Click plot to pin selection.
- E — Export selected bar to Common/Files as CSV (honesty header + price,bid,ask,delta rows).
- I / Esc — Toggle About panel (rule summary, cache key, tick count, self-test status).
- Ctrl+wheel / Shift+wheel / wheel on price axis — Zoom price span.
- Drag CVD top edge — Adjust CVD strip height (96–520px before UiScale).
- Toolbar — instrument preset, layout, volume mode, CVD, inspector, language, About.
Instrument Presets
| Preset | Performance | Row size | Spread cap | CVD height | Palette |
|---|---|---|---|---|---|
| Off | From inputs | From inputs | From inputs | From inputs | From inputs |
| Gold | Gold | Manual 50pt | 250pt | 280px | Warm gold/green/red |
| FX | Balanced | Auto | 80pt | 220px | Cool blue/green |
| Index | Lite | Manual 20pt | 400pt | 200px | Muted gray |
Presets change row size, spread cap, CVD height, and colors. They do not drop ticks already in memory. A row or spread change rebuilds ladders only.
Recommended Starter Settings
- Gold (XAUUSD): InstrumentPreset = Gold, or PerformancePreset = Gold, RowSizeMode = Manual with RowSizePoints suited to your broker digits.
- FX majors: InstrumentPreset = FX, PerformancePreset = Balanced, RowSizeMode = Auto.
- Indices: InstrumentPreset = Index, PerformancePreset = Lite if the CPU is busy.
- Readable UI: UiScale 1.40–1.80, FontSizeUi 14–16, FontSizeDigits 11–13, ShowDeltaTable = true.
- Clean look: ShowSessionShade = false, HideNativeCandles = true, FollowLastBar = true, RightPaddingBars = 3.
Parameters — How to Configure
Data
- HistoryBarsTarget — how many bars keep footprint ladders (default 400). Higher = more history, more RAM/CPU.
- TickChunkSize — soft cap per CopyTicksRange chunk (default 80000).
- SyntheticTickWeight — weight when tick volume is 0 (default 1.0).
- MaxSpreadPoints — filter wide spreads: -1 auto (200 metals / 80 FX), 0 off, else points.
- PreferTradeTicks — use real BUY/SELL flags when the feed provides them (default true).
- AggressorRuleVersion — keep AggressorRule_v1 for production.
- EnableSynthesisAudit — debug only; replay/compare synthesis (leave false).
Rows
- RowSizeMode — Auto (adapts) or Manual.
- RowSizePoints — bucket height in points when Manual (e.g. gold often needs a larger step).
- PriceMapMode — SideAware (default), Last, or Mid — how ticks map into price rows.
Footprint
- LadderLayout — Beside (ladder next to candle) or Inside (inside the body).
- VolumeDisplay — AskBid (default), Delta, or TotalDelta.
- ShowImbalance / ImbalanceRatio / MinImbalanceVolume / StackedLevels — imbalance highlight rules (default ratio 3.0, stack 3).
- MinPxPerBarForDigits / MinCellHeightForDigits — minimum zoom before Bid×Ask numbers paint.
Candles
- ShowCandles, BodyOpacity, BullColor, BearColor — candle look on the Canvas.
CVD
- ShowCVD — show the CVD strip (also forced on when the delta table is on).
- CVDReset — None / Daily / Session / ManualAnchor.
- SessionTemplate — FX London overlap or Custom; Custom uses SessionStartHour / SessionEndHour.
- CVDManualAnchorTime — reset anchor when CVDReset = ManualAnchor.
- ShowSessionShade — soft session wash (default off for a clean solid chart).
- CvdStripHeight / ShowCvdCurve — strip height and whether the CVD curve draws.
Divergence
- ShowCvdDivergence — yellow neutral circles on CVD (default true). Not trade arrows.
- CvdDivMarkSize / CvdDivMarkColor — mark size and color.
Viewport
- MinPxPerBar / MaxPxPerBar — zoom range (raise Max to keep digits readable; max 280).
- DefaultBarsVisible — first-load bar count (default 32).
- FollowLastBar — stick to the live candle until you pan.
- RightPaddingBars — empty bars to the right of the live candle (default 3).
- HideNativeCandles — hide MT5 candles so only Canvas candles show (default true).
- CanvasBehindObjects — keep Bubble/objects paintable above the Canvas.
UI
- UiScale — global UI scale (default 1.60). Toolbar + inspector scale together.
- FontSizeUi / FontSizeDigits — UI labels vs footprint digits.
- ShowDeltaTable / DeltaTableHeight / ShowDeltaHistogram — bottom Volume|Delta|Cum block.
Inspector
- ShowInspector / InspectorWidth — right-side selected-bar panel.
Performance
- PerformancePreset — Balanced (default), Gold (heavier / denser), Lite (lighter), Manual (you own TimerMs / caps).
- TimerMs — refresh timer when Manual (default 75).
- MaxTicksInStore — tick store cap (default 3,000,000).
Preset
- InstrumentPreset — Off (keep inputs), Gold, FX, Index. Toolbar can switch live. Off keeps your typed inputs.
Honesty / Language / Colors / Alerts / Debug
- ShowHonestyBadge — set-file only; not drawn on chart by default.
- Language — Lang_zh or Lang_en.
- Ask/Bid/Delta/Imbalance/POC/Background colors — visual theme.
- Session shade colors / second session — optional shade only; does not reset CVD unless CVDReset = Session.
- EnableAlerts + cooldown / popup / push / email — optional alerts (default off).
- VerboseLog — Experts log noise for debugging (leave false).
Honesty Contract
The honesty statement — "Synthetic order flow, not exchange Level 2 / not a full-market tape" — appears in:
- The #property description (visible in the indicator dialog)
- The Experts log on init
- The About panel (toolbar i or press I)
- Every exported CSV header
The on-chart badge is off by default. The data source chip (Synth / Trade / Mix) in the toolbar always reflects the active classification path.
Architecture
- One bitmap — All pixels (candles, ladders, axes, CVD, inspector, toolbar) are drawn on a single CCanvas. No OBJ_LABEL, OBJ_TEXT, OBJ_RECTANGLE, or ObjectCreate calls.
- Tick window is authoritative — Ticks are stored in absolute millisecond time. Bar ladders are a replay cache. A timeframe switch increments the generation, drops all ladders, and discards any in-flight tick copy whose generation no longer matches.
- Generation guard — m_ctxGen protects against stale CopyTicksRange results during symbol/period switches.
- Incremental update — The latest bar is updated incrementally as new ticks arrive; completed bars are committed and not re-replayed unless their row size or spread filter changes.
- Empty-tick handling — When CopyTicksRange returns 0 with no error, the range is retried twice then accepted as empty. Bars with no ticks are marked offline and drawn as candles without ladders — never as fake zero-delta rows.
- Self-test — RunSelfTest() runs on every OnInit. 45 test cases verify the classification rule, row accumulation, provisional vs. replayed bar, imbalance/stack, cell mode, cache key, and series lookup. A failure shows a red chip on the toolbar.
Performance Presets
| Preset | History bars | Tick cap | Timer | Default bars | Row target |
|---|---|---|---|---|---|
| Balanced | 500 | 3,000,000 | 75ms | 32 | 14 |
| Gold | 180 | 1,200,000 | 100ms | 30 | 10 |
| Lite | 120 | 600,000 | 75ms | 24 | 8 |
| Manual | 20-800 | 50K-5M | 25-250ms | 5+ | from input |
Balanced auto-selects Gold caps on XAU/GOLD/XAG/SILVER symbols. Timer downloads ticks and replays them; OnCalculate only refreshes rates when the bar count changes. Frame time is shown on the toolbar and turns amber above 16ms.
Expected Behavior
Closed market / no ticks results in empty footprint is normal. Same symbol on different brokers can produce different ladders. Synthesis is honest Path A for FX/CFD when trade flags are absent — never marketed as exchange L2.
Complements
Works alongside bubble-style delta tools and session volume profile workflows. This product is a footprint + CVD chart — not a bubble clone and not a session VP replacement.
Disclaimer
For analysis only. No profit claims. Always manage your own risk.
