Market Rotor - Increment Contamination Test [FibonacciFlux]

606
Second in a series of published experiments: take a correction that is widely assumed to work, implement it honestly, and find out what it actually does. This one tests the most common way of accidentally manufacturing rotation - putting the same-bar price increment into the second axis and then reading the resulting circulation as structure.

It detects that contamination reliably, though not precisely - the spread is measured below. It cannot do the converse, and the boundary where it starts getting the converse wrong is measured below.

🔶 USAGE

🔹 What this is for

Any indicator that claims rotation, circulation or lead-lag between price and a flow-like series is reading the antisymmetric part of a lag-1 covariance. Load your two axes here first. If the reading comes back near 1, the circulation that indicator is showing you is the increment leaking into its own second axis, and there is nothing else to interpret.

🔹 Reading the shading

  • Red - the ratio sits within 0.25 of 1. An increment-contamination component accounts for the observed circulation.
  • Grey - anything else. Not classified. This is not evidence that the rotation is genuine.


snapshot

BTCUSDT 1H at the defaults. The band is red across effectively the whole span, and that is the finding rather than a rendering quirk: on this data the circulation between price and flow is contamination-shaped nearly all of the time. Note also how much of the pane the amber R_art area occupies relative to the pale R_obs line running through it - the artifact term is routinely larger in magnitude than the thing it is decomposing, which is why the ratio sits above 1 in about two thirds of readings.

There is no green state, for the same reason as in the first script: this test is one-directional. It can find contamination; it cannot certify its absence.

🔹 Reading the plots

The amber filled area is R_art, the circulation Identity I alone accounts for; the pale line inside it is R_obs, the observed circulation; green is R_res, what is left. The verdict band is red rather than amber precisely so that it is not the same colour as the series it is a verdict about.

The ratio is a signed share, not a fraction. R_res is defined as R_obs - R_art, so the additive identity cannot fail and proves nothing by itself; what justifies the split is that LAMBDA is linear in y, so writing y = beta*dx + e gives R_art and R_res exactly as the circulation contributed by each part. Nothing bounds the ratio to [0, 1], and on real data it usually is not there: on BTCUSDT 1H it exceeds 1 in 66% of readings on the default axis, 79% on the order-flow axis. Read "near 1" as "contamination accounts for it", never as a percentage of it.

The Data Window carries the ratio, beta, corr(y, dx), LAMBDA, T_K and both axes.

🔹 Choosing the second axis

CLV x volume is the default, and deliberately not the best proxy. Order flow from lower-timeframe volume delta is the better second axis. The original reason for not defaulting to it was that a chart tab hung twice while it was selected, once on a daily chart and once on the 1H default, both on a two-core machine.

That attribution has since weakened and this paragraph is the correction. Both of those tabs stopped responding during automated testing, not during ordinary use. The same symptom later appeared twice more with no lower-timeframe request involved at all, and the axis has since been selected and exercised on a 1H chart without incident. Nothing here is attributable to the request. The default stays on CLV as the conservative choice rather than as a fix for a diagnosed problem - select order flow deliberately, not nervously.

What the default does buy you is real, and it is a cost rather than a hazard: request.* must sit at global scope, so the call always runs, but the timeframe it asks for is now conditional. On any axis other than order flow it is pointed at the chart's own timeframe and returns one intrabar per bar instead of sixty.

Volume z-score on its own is the useful control: it carries almost no increment at all (beta +0.016, corr +0.009), and its ratio consequently degenerates - a non-verdict, not a clean bill of health. Momentum is a control, not a choice - it sets y to a difference of return EMAs, which is nearly dx itself. Watch beta when you switch to it, not the ratio: measured on one bar of BTCUSDT 1H the ratio barely moved (1.119 to 1.084) because the default is already saturated near 1, while beta on that same bar jumped from 0.838 to 1.270. The identity is firing; the ratio has no room left to show it.

The four axes disagree, and that is information rather than a defect. On one bar of BTCUSDT 1H: order flow 1.119, CLV x volume 0.965, momentum 1.084 - and volume z-score -2.104, which is not a verdict at all but the signature of a near-zero denominator, discussed below.

🔹 Warm-up and repainting

Nothing plots until 2 x W + z-length + detrend-length bars have elapsed: 574 at the defaults, about 24 days of 1H data.

Two things that will bite you. First, when R_obs is near zero the ratio is meaningless and still prints to five decimals - on the volume z-score axis this was measured at R_obs 0.013 giving a ratio of -2.10 with beta 0.07, that is, no contamination at all and a nonsense ratio. Read LAMBDA first: if there is no circulation, decomposing it means nothing. Second, if you switch to the order-flow axis, set the lower timeframe explicitly before going above 4H - on a daily chart the warm-up needs roughly 14,000 intrabars.

And one silent substitution. Where the lower-timeframe request returns nothing - beyond the intrabar history limit, or on a plan that cannot serve the chosen lower timeframe - y falls back to CLV with no visible break. The plotted history can therefore be a mixture of two different second axes with an invisible switchover, and every Data Window statistic inherits it. Watch corr(y, dx) and beta for a step change if that matters to you.

🔶 DETAILS

🔹 The identity being tested

Pine Script®


In discrete time x_s(y_{s+1}-y_s) - y_s(x_{s+1}-x_s) collapses exactly to x_s*y_{s+1} - y_s*x_{s+1}, so the circulation needs no angles, no atan2, no origin estimate and no lag operator. An earlier version of this work used atan2 and every one of those was required - each a free parameter able to manufacture the result.

Call it circulation, not a rotation rate: mean[x*ydot - y*xdot] is mean[r^2 * phidot], an areal velocity, and it equals a rotation rate only if the squared radius and the angular velocity are uncorrelated.

🔹 What it detects, and what it does not

Reimplemented outside Pine and swept over synthetic series whose truth is known by construction, 5 seeds, W = 250:

  • y = beta*dx + noise, no rotation at all - the ratio has median 0.94 to 0.97 with a 10th-to-90th percentile spread of roughly 0.77 to 1.17. Centred on 1, but not precise, and independent of the sign of beta.
  • a clean 2-D rotation with no dx in y at all - the ratio reads 0.46 to 0.83, rising with rotation speed. The test therefore cannot certify that a rotation is genuine.


The false positive depends on persistence at least as much as on speed. The rotation speed at which a clean, uncontaminated rotation starts reading above 0.75 and is reported as contamination, by the AR persistence rho of the rotating system:

Pine Script®


W and the noise level did not move that boundary; persistence moved it by more than 5x.

The sign of beta is deliberately not used for anything. Across more than 50 configurations it tracks the sign of whatever coupling exists, flipping with the direction of a genuine rotation as readily as with the sign of the contamination. Related structural fact, worth checking rather than trusting: LXD is non-positive by construction, so the sign of R_art is fixed by the sign of beta. Measured across synthetic rotation in both directions, synthetic contamination and real data, LXD was positive in 0.0% of readings.

🔹 On real data

Two structurally different flow proxies give the same verdict on 1H crypto, which is the finding worth taking away:

Pine Script®


My own earlier work on this data, which this script reimplements, reported 108.3% with corr +0.377 on its own flow proxy, and the live script on lower-timeframe volume delta reads 1.119 with corr +0.533. Four different constructions of the second axis, one answer: the circulation people read between price and flow is the increment leaking into the flow axis.

🔹 Implementation and reproducibility

Covariances are computed from their definition because Pine has no ta.cov. y is never lagged: an earlier cycle established that lagging it manufactures rotation and reverses the sign of the true antisymmetric lag covariance. The x pipeline was verified against an independent reimplementation - identical to five decimal places on the same bar. The synthetic scenarios use a seeded generator, so every number above is reproducible.

🔶 SETTINGS

🔹 Axes

  • Second axis y - CLV x volume (default), order flow from lower-timeframe volume delta, volume z, or the momentum control.
  • Equilibrium EMA - detrends x (default 34).
  • Z-score length - standardises both axes (default 40).
  • Lower timeframe for volume delta - blank picks one from the chart timeframe.


🔹 Windows

  • Rolling window W - LAMBDA, beta and T_K are all estimated over it (default 250, minimum 100; shorter windows make the verdict band fragment into bar-to-bar stripes).
  • Warm-up multiplier - bars withheld before plotting, as a multiple of W (default 2).


🔹 Display

  • R_obs, R_art, R_res - the three series.
  • T_K residual torque - off by default; a volume-weighted detailed-balance statistic that did not survive its own null.
  • Shade background when contamination is identified - the red band.
  • T_K display scale - default 30, because T_K is far smaller than the three circulation series and draws as a flat line on zero at 1; 30 is simply what made it readable here.


Open source under the Mozilla Public License 2.0. Replications and refutations welcome, particularly a second-axis construction that stays uncontaminated under a test I have not thought of.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.