Cival Auction Structure — Platform Compatibility
The ATAS plugin is the reference implementation. Each port computes what its platform's data allows and labels
anything approximate or unavailable inside the indicator itself. The sections below are the READMEs that ship next
to each port's source file (ports/<platform>/README.md).
TradingView (Pine Script v6)
Cival Auction Structure for TradingView
Port of the ATAS original Cival Auction Structure v1.0.0.0 to Pine Script v6 (CivalAuctionStructure.pine).
Builds a time-price-opportunity (TPO) profile per session: for every price row it counts the distinct time brackets (default 30 minutes) that visited the row. These are bracket counts, not volume. From the profile it derives the time point of control (TPOC), a 70 % value area, single-print rows, rule-based shape and poor/excess-edge candidates, failed-auction marks against the previous completed profile, and prior-session TPOC / TVAL / TVAH levels. Everything is computed on closed bars; shape and edge labels are heuristics and hypotheses, not confirmed market structure.
Requirements
| Item | Requirement |
|---|---|
| Platform | TradingView, Pine Script v6 |
| Real visited prices | Premium or Ultimate plan (request.footprint()): rows with traded volume are the visited prices. |
| Any other plan | Runs in APPROXIMATE mode: visited prices come from lower-timeframe candle ranges (or the chart candle range). |
| Chart timeframe | Best at or below the bracket length (default 30 minutes). Bars that span several brackets are flagged COARSE / APPROXIMATE. |
| Chart type | Standard candles / bars. |
Install
- Open the Pine Editor, paste the full contents of
CivalAuctionStructure.pine, Save, then Add to chart. - Set TPO row size (ticks) and TPO bracket minutes for the instrument.
- Set Session start (minutes after midnight) and, if needed, Session timezone to the session you want profiled
(blank = the symbol's exchange timezone; or an IANA name such as
America/New_York, orUTC-5). A profile whose first bar starts after the session start (history begins mid-session, or the market opens later than the configured start) is flagged PARTIAL and its prior-session levels are withheld, exactly as in the original. Crypto "sessions" are your own convention. - Optional alerts: Create alert > Condition: Cival Auction Structure > Any alert() function call. Off by default.
The second panel line states the data mode: FOOTPRINT visited prices (real rows), ... candle ranges - APPROXIMATE (no footprint)
or MIXED.
Verification note: the script was compiled on TradingView's servers (0 errors, 0 warnings). It has not been observed running on a live chart or against a Premium footprint feed in the build environment.
Feature matrix
Values: Full / Approximate / Not available / Not ported.
| Feature | ATAS original | This port | Notes |
|---|---|---|---|
| Per-session TPO from unique bracket visits (time, not volume) | Yes | Full with footprint; Approximate without | Without footprint the visited rows are lower-timeframe (or chart) candle ranges, so interior rows with no trades count as visited. |
| Visited prices from footprint rows with volume | Yes | Approximate | TradingView returns rows at TPO row size directly; the original groups tick rows. Row grid alignment is assumed to be multiples of the row size. |
| Candle-range fallback | Chart candle range | Approximate | Port prefers lower-timeframe candle ranges (finer bracket assignment); falls back to the chart candle range. |
| Bracket assignment | Bar open time | Full (footprint) / Approximate (ranges) | With lower-timeframe ranges each intrabar candle is assigned to its own bracket. |
| TPOC (lowest price on ties) | Yes | Full | |
| Value area (70 %, contiguous expansion, equal sides expand together) | Yes | Full | VAL/VAH use half-row edges like the original. |
| Single-print rows (count 1) | Yes | Full | Counted in the panel; gold in the histogram. |
| Shape candidates: P, b, D/balanced, B/double distribution, trend/low-overlap | Yes | Full | Same thresholds (0.7 / 0.3, 10 rows, 5 brackets, 80 % rows with 2 or fewer, 50 % peaks). |
| Poor / excess high and low candidates | Yes | Full | |
| Adaptive row grouping when the range exceeds 2000 rows (union of bracket sets) | Yes | Full | Row size doubles; merged rows keep a true bracket union. |
| Developing profile information panel (8 lines) | Yes | Full content | Table; default Compact panel shows title + status + TPOC line, as in the original. |
| PARTIAL / APPROXIMATE / COARSE status labels | Yes | Full | See "Known differences" for the one change in when PARTIAL is set. |
| Prior-session levels: TPOC, TVAL, TVAH (strength 2 / 1 / 1) | Yes | Full with footprint | Withheld when the profile is PARTIAL or APPROXIMATE, as in the original. Port-only option publishes APPROXIMATE (not PARTIAL) profiles with an (approx.) suffix; off by default. |
| Level lifecycle: untouched until first touch, then Tested | Yes | Full on closed bars | The original also marks touches intrabar; this port updates at bar close. |
Failed-auction marks vs previous completed profile (FA prior TPO high/low) |
Yes | Full with footprint | Same publication rule as the levels. |
Zone fill, level line, label with state (New / Tested) |
Yes | Full | Labels use the original's expanded wording (Time value center, Time value low/high). |
| Zone ranking and Maximum visible zones | Yes | Full | Same rank formula; ranking uses the latest price at the last bar. Viewport-based culling is Not available (Pine cannot see the scrolled window). |
| Show touched levels | Yes | Full | Touched levels end at the touching bar, grey. |
| TPO histogram at the right edge | Yes (pixels) | Approximate | Drawn as boxes to the right of the last bar; width in bars is scaled to the largest count (port-only width input). Above 380 rows neighbouring rows are drawn as one bar. |
| Letters per bracket (A, B, C...) | Not drawn by the original either | n/a | The original shows counts as a histogram. |
| Session start / timezone | Windows timezone ids | Approximate | IANA names or UTC+-n. Blank = exchange timezone, not the chart's display timezone. |
| Initial balance minutes | Setting exists, unused by this indicator | Not ported | |
| Alerts on closed signal / level touch | Yes (off) | Full | alert() per bar close, off by default. Sound setting Not ported. |
| Chart-clarity compact mode | Yes | Approximate | Plain-language labels, 3 zones, last 8 marks. The cross-indicator "current chart read" board is Not available. |
| CSV export (signals / zones) | Yes | Not available | Pine cannot write files. |
| Share with Cival Decision Panel | Yes | Not ported | No cross-indicator bridge. |
| Panel pixel layout (offset, width, automatic placement) | Yes | Not ported | Replaced by Panel position. |
| Label overlap avoidance / minimum bar spacing | Yes | Not ported | Pixel geometry is not readable in Pine. |
| Presets / review mode | None in this indicator | n/a |
Settings mapping
Names and groups mirror the ATAS display names. Defaults come from Cival.AuctionStructure.settings.json.
| Group | Input | Default | Notes |
|---|---|---|---|
| Calculation | TPO row size (ticks) | 4 (1-1000) | Passed to request.footprint() as the row size. |
| Calculation | TPO bracket minutes | 30 (1-240) | |
| Appearance | Show TPO histogram | on | |
| Session | Session start (minutes after midnight) | 0 | |
| Session | Session timezone (blank = chart; otherwise input UTC) | blank | Blank = exchange timezone; IANA or UTC+-n text. |
| Appearance | Show information panel | on | |
| Appearance | Maximum visible zones | 12 | 3 in compact display. |
| Appearance | Show touched levels | off | |
| Appearance | Show labels | on | |
| Appearance | Bull color / Bear color | #3CB371 / #FF6347 |
|
| Information panel | Panel font size | 13 | Approximate mapping to text sizes. |
| Information panel | Compact panel (title + two lines) | on | |
| Performance | Maximum bars back | 10000 | |
| Alerts | Alerts on closed signal / level touch | off | |
| 00 Chart clarity | Compact display / Full analysis detail | on / on |
Port-only inputs (group Port (TradingView only)): Estimation timeframe (blank = automatic: the chart bars when they are no longer than one bracket, otherwise 1D+ 15m, 4h+ 5m, else 1m), Footprint completeness tolerance % (default 1), Publish prior-session levels from APPROXIMATE profiles (default off), Histogram width (bars, default 20), Panel position.
Not ported: Initial balance minutes (unused here), Panel top offset / width / automatic placement, Show readiness/status panel (no effect in the original), Compact volume numbers, Show bubble volume numbers, Bubble number color (no bubbles drawn), Avoid overlapping labels, Minimum bar spacing for signal labels, CSV export folder, Alert sound, Share with Cival Decision Panel.
Known differences from ATAS
- Footprint rows. TradingView builds rows from its own intrabar data and returns them at the requested row size; ATAS groups the provider's tick rows. The row grid is assumed to be multiples of row size x tick. If a feed aligns rows differently, a level can sit up to one row away from where ATAS would put it.
- PARTIAL in fallback mode. In ATAS, a missing footprint sets both APPROXIMATE and PARTIAL. Here, missing footprint sets only APPROXIMATE; PARTIAL is reserved for a session that starts after its configured start, a row budget overflow, or a footprint that fails the completeness check. Publication of prior-session levels is withheld in both cases by default.
- Bar span detection. ATAS compares the bar open with the next candle's time; the port uses the bar's own close time. Bars that straddle a market gap are therefore not flagged by the gap itself.
- Lower-timeframe fallback is not the original's fallback. It is finer than the chart candle range but still assumes every row between an intrabar candle's low and high was visited. Treat it as APPROXIMATE, which it is labelled.
- Timing. Levels, marks and touches are evaluated at bar close. ATAS also updates touch state on the forming candle.
- Session maths. Session start is computed as local midnight plus the start minutes in the chosen timezone; around daylight-saving changes this can differ by the shifted hour from ATAS's elapsed-time rule.
- Row budget. Up to 2000 rows per session after adaptive grouping, as in the original. The histogram draws at most 380 boxes (neighbouring rows merged for display only).
- Object limits. TradingView caps boxes, lines and labels at 500 each; only the highest-ranked zones are drawn.
- Estimation timeframe. Lower-timeframe data availability depends on your plan; history older than the intrabar limit falls back to chart candle ranges and is flagged APPROXIMATE.
- Arithmetic. Float instead of
decimal; row indices use a 1e-6 tolerance before flooring.
NinjaTrader 8 (NinjaScript)
Cival Auction Structure — NinjaTrader 8
Compile on import: NinjaScript Editor → F5. This file has not been compiled against NinjaTrader 8 (NT8 was not available where the port was written). It was type-checked at C# 7.3 against hand-written stand-ins for the NinjaScript / SharpDX types, and every NT8 API name was checked against the NinjaTrader 8 help guide, but only your F5 compile proves it against the real platform.
Summary and requirements
Cival Auction Structure builds a time-price-opportunity (TPO) profile per session: for every price row it counts the distinct time brackets that visited that row (time at price, not volume). It shows the developing TPOC, a 70 % value area, a rule-based shape candidate (P / b / D / B / trend), single prints, poor / excess high-low candidates, failed-auction marks against the prior completed profile, prior-session TPOC / value-area levels, and a right-edge histogram. Shapes and edge labels are descriptive candidates, not forecasts. It is an Indicator only: no orders, no network.
Requirements:
- Any NinjaTrader 8 chart works, but exact visited prices need Order Flow Volumetric Bars (Order Flow+ entitlement, Ticks per level 1 recommended). Without Volumetric data the bar's high-low range is used and the profile is labelled APPROXIMATE; approximate or partial profiles never publish prior-session levels or failed-auction marks.
- Use small time bars (the default bracket is 30 minutes; a bar that spans a bracket boundary makes the profile APPROXIMATE / COARSE). Minute or second bars give exact bracket assignment.
Calculate = OnBarClose; nothing repaints.
Install
- Copy
CivalAuctionStructure.cstoDocuments\NinjaTrader 8\bin\Custom\Indicators\. - New → NinjaScript Editor, press F5 (Compile).
- Chart → right-click → Indicators → Cival Auction Structure.
- Set Session start (minutes after midnight) for the instrument. Leave Session timezone blank to use chart time (see the note under settings).
Feature matrix
| Feature | ATAS original | This port | Notes |
|---|---|---|---|
| TPO bracket counting (distinct brackets per row, not volume) | Yes | Full | Adaptive row grouping (row size doubles to keep ≤ 2000 rows; visit sets are unioned, never double-counted). |
| Visited prices from traded rows | Footprint rows | Full | Volumetric price levels with volume > 0, scanned one tick at a time. |
| Resolution when Volumetric Ticks per level > 1 | n/a | Approximate | Only ticks that report volume count as visited; use Ticks per level 1 for exact TPO rows. |
| Candle-range fallback (no footprint) | Yes, labelled | Approximate | Labelled "APPROXIMATE: candle range fallback"; no prior levels / failed auctions published from it. |
| Developing TPOC, value area (70 %), expansion rule | Yes | Full | Same arithmetic, including the original's half-row offsets (see differences). |
| Shape candidate (P / b / D / B / trend-low-overlap) | Yes | Full | Rule-based candidates. |
| Single prints | Yes | Full | Count in the panel; single-visit rows are gold in the histogram. |
| Poor / excess high and low candidates | Yes | Full | |
| Failed auctions vs prior completed profile | Yes | Full | Uses the prior profile's highest / lowest TPO row price, as the original does. |
| Prior-session TPOC / TVAL / TVAH levels | Yes | Full | Created at the first bar of the next session; only from complete, non-approximate profiles. |
| Level lifecycle (New → Tested) | Yes | Approximate | The original also tests levels on the forming candle; this port tests on closed bars only (OnBarClose). |
| Right-edge histogram | Yes | Full | One thin bar per row, width ∝ bracket count (max 100 px). |
| PARTIAL / APPROXIMATE / COARSE statuses | Yes | Full | See differences for the no-footprint wording. |
| Session start minutes / timezone | Yes | Approximate | Same daily-session rules (incl. DST handling); time-zone semantics differ, see settings note. |
| Initial balance minutes | Setting (no effect here) | Not ported | Accepted for settings parity; like the original it does not change this profile. |
| Panel (TPOC, VA, shape, visits, edges, row size, data status) | Yes | Approximate | Drawn by the indicator; no cross-indicator auto-arrange. |
| Markers + labels with overlap avoidance | Yes | Full | |
| Compact display / Full analysis detail | Yes | Approximate | Full detail expands abbreviations as the original does; compact shows ≤ 3 levels, ≤ 8 recent marks and a one-line read in place of the shared "current chart read" board. |
CSV export (AuctionStructure-signals.csv, AuctionStructure-zones.csv) |
Yes | Full | Same columns; the invalidated column is always blank (this indicator has no invalidation). |
| Alerts (off by default) | Yes | Approximate | NT Alert(), real-time only; sound name maps to <NT install>\sounds\<name>.wav. |
| Rebuild when provider revises processed history | Yes | Not available | Reload the data to recalculate. |
| Share with Cival Decision Panel | Yes (ATAS-only bridge) | Not ported | Not part of the shipped settings reference. |
| Review mode / presets | None in the original | — | — |
Settings mapping
| ATAS group / name | NT8 property | Default | Notes |
|---|---|---|---|
| Calculation / TPO row size (ticks) | TicksPerRow |
4 (1–1000) | |
| Calculation / TPO bracket minutes | BracketMinutes |
30 (1–240) | |
| Appearance / Show TPO histogram | ShowHistogram |
true | |
| Session / Session start (minutes after midnight) | SessionStartMinutes |
0 (0–1439) | |
| Session / Session timezone (blank = chart; otherwise input UTC) | SessionTimeZone |
blank | Semantics adapted. NinjaTrader bar timestamps are not UTC. When a Windows time-zone id is entered, bar times are read as the PC's local time, converted to UTC, then to that zone to find the session start. Blank = chart time as shown. If your chart is not on PC-local time, leave this blank and express the start in chart time. An unknown id is reported in the panel and chart time is used. |
| Session / Initial balance minutes | InitialBalanceMinutes |
60 (1–240) | No effect (as in the original). |
| Appearance / Show information panel, Panel top offset, Panel width | ShowPanel, PanelTop, PanelWidth |
true, 50, 380 | |
| Appearance / Avoid overlapping labels, Minimum bar spacing, Maximum visible zones, Show touched levels, Show labels | AvoidLabelOverlap, MinimumLabelBarSpacing, MaxVisibleZones, ShowTouched, ShowLabels |
true, 6, 12, false, true | |
| Appearance / Bull color, Bear color | BullColor, BearColor |
MediumSeaGreen, Tomato | WPF Brush |
| Information panel / Panel font size, Compact panel | PanelFontSize, CompactPanel |
13, true | |
| Export / CSV export folder (blank disables) | ExportFolder |
blank | |
| Performance / Maximum bars back | MaxBarsBack |
10000 | |
| Alerts / Alerts on closed signal / level touch, Alert sound | EnableAlerts, AlertSound |
false, alert1 |
|
| 00 Chart clarity / Compact display, Full analysis detail | CleanChart, FullAnalysisDetail |
true, true |
Not ported (and why)
| ATAS setting | Reason |
|---|---|
| Automatic panel placement | Needs ATAS's shared panel registry. Give each Cival panel a different Panel top offset in NT8. |
| Show readiness/status panel | Has no effect in the ATAS analytics indicators. |
| Compact volume numbers, Show bubble volume numbers, Bubble number color | This indicator draws no volume bubbles. |
Known differences from the ATAS original
- Visited-price source. ATAS uses footprint rows; this port scans Volumetric levels tick by tick (
GetTotalVolumeForPrice). With Ticks per level above 1 the resolution is coarser; use 1 for exact rows. - Bar open time. NinjaTrader stamps time bars with their close time. Bracket assignment uses the bar's open: exact for Minute and Second bars (including the base period of Volumetric bars), otherwise the previous bar's stamp. A bar whose span crosses a bracket boundary makes the profile APPROXIMATE, as in the original.
- No-footprint wording. The original marks a bar with no footprint rows both PARTIAL and APPROXIMATE and then shows the PARTIAL text. This port marks it APPROXIMATE only and says why ("candle range fallback" versus "a bar spans several brackets"). PARTIAL is reserved for session-start-before-history, history gaps, row-limit hits and Volumetric rows that fail the 1 % volume reconciliation. The effect is the same: no levels or failed auctions from such profiles.
- Original arithmetic kept. Value-area low / high are the value-area rows' price minus / plus half a row (
VAL = lowest VA row − row/2,VAH = highest VA row + row/2), and failed-auction references are the highest / lowest TPO row's lower-edge price, exactly as in the original. - Closed-bar level tests. Level "Tested" status updates when a bar closes, not on the forming candle.
- Panels. Drawn with SharpDX at the Panel top offset; no auto-arrangement across indicators.
- Numeric type. Doubles with a 1e-6 tick tolerance; rows are keyed by integer tick index internally.
TPO shapes, poor / excess edges and failed auctions are rule-based descriptions of what was observed. They are not calibrated probabilities and no profitability is claimed.