Strategy · Pine Script v6 · On the chart

Parity probe 03 - equity mirror

by pineforge-4pass· code credited to PineForge contributors 2026

This strategy mirrors TradingView strategy.equity by computing position quantity as equity divided by close at each potential entry bar.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code56
Settings0inputs
LicenceApache-2.0
Last update5 days ago23 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

56 lines of Pine Script v6 from validation/anomaly-equity-mirror-strategy-equity-01/strategy.pine, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.

strategy.pine
// This Pine Script® code is licensed under Apache-2.0
// SPDX-License-Identifier: Apache-2.0
// © PineForge contributors 2026
//
// Parity probe 03 — strategy.equity per-bar mirror
//
// Purpose: isolate the IES integration probe family's PnL drift (2.54% on
// the strict thresholds, sole strategy below the strong tier). The drift
// occurs because every entry sizes via ``strategy.equity * i_risk_pct *
// regime_size_mult * quality_mult / risk_per_unit``, and tiny IIR-warmup
// deltas in ATR/ADX (engine has 5 months of warmup OHLCV vs TV's full
// chart history) compound across thousands of trades into a $29k equity
// gap by 2026-04-21 — at which point per-bar regime and risk match TV
// bit-for-bit but the qty is locked at engine_equity / TV_equity ≈
// 0.9731. The disagreement therefore lives in strategy.equity itself.
//
// This probe sets ``qty = strategy.equity / close`` at every periodic
// entry and immediately flattens on the next bar, so the exported
// ``Size (qty)`` column reads back ``strategy.equity / close`` at each
// trade's bar. Comparing engine vs TV row-by-row pinpoints the FIRST
// trade where strategy.equity diverges (i.e., where the cascade
// starts) and quantifies the divergence rate at every point afterward.
//
// Trade shape: long-only, pyramiding=0, no commission/slippage so the
// only mover of strategy.equity between trades is the prior trade's
// realised P&L plus the open position's mark-to-market. The 100-bar
// period spaces trades far enough apart that the prior trade always
// closes before the next entry computes its qty.
//
// TV setup: 15m chart on BINANCE:ETHUSDT.P, same window as
// data/ohlcv_ETH-USDT-USDT_15m.csv. Export "List of Trades" to
// ``tv_trades.csv`` in this folder.
//@version=6
strategy("Parity probe 03 - equity mirror", shorttitle="par_p03", overlay=true, initial_capital=1000000, commission_type=strategy.commission.percent, commission_value=0, slippage=0, default_qty_type=strategy.fixed, default_qty_value=1, pyramiding=0, process_orders_on_close=false)

// ---- engine -------------------------------------------------------
// Wall-clock entry trigger: 00:00 UTC every Monday. Using a
// timestamp-based rule (not bar_index) so engine and TV fire on the
// SAME absolute bars; bar_index-based triggers shift by the warmup
// prefix and break verify_corpus.py's align-by-time stage. Pine's
// `dayofweek.monday` constant is integer 2 (Sun=1, Mon=2, ..., Sat=7);
// the engine's codegen does not yet expose `dayofweek.*` namespace
// constants, so the literal is inlined here.
bool fire = dayofweek == 2 and hour == 0 and minute == 0 and strategy.position_size == 0

// qty encodes strategy.equity at this bar; round to 3 decimals so
// the exported CSV is bit-stable across re-runs.
float qty_dyn = math.round(strategy.equity / close * 1000) / 1000

if fire and qty_dyn > 0
    strategy.entry("E", strategy.long, qty=qty_dyn, comment="qty = equity/close")

// Exit at next bar's open so each entry maps to a single trade row
// whose Size (qty) reveals strategy.equity at the entry bar.
if strategy.position_size > 0 and bar_index > strategy.opentrades.entry_bar_index(0)
    strategy.close("E", comment="next-bar flatten")

Overview

Parity probe 03 - equity mirror signals long entries every Monday at 00:00 UTC when no position exists and flattens at the next bar open. The overlay=true directive draws signals directly on the price chart. No custom inputs exist. The probe isolates equity drift between Pine Script engines and TradingView by exporting size values that reveal first divergence points. It serves validation purposes with no stop loss.

Details

Published by

pineforge-4pass on GitHub

Code credit

PineForge contributors 2026, as written in the script's header

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Sessions & time

Markets

Crypto

Timeframes

M15-H1

Risk Notes

  • The strategy enters trades without a stop loss

Topics

algorithmic-tradingbacktestingparitypine-scriptpinescriptquantitative-financetest-corpustradingview

Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

361 stars

Forven S01512 — Monday Drift is a calendar-based long trading strategy designed to exploit time-based recurring market patterns. It tracks UTC calendar days and hours to enter a long position at a specified day and hour, holding it for a fixed duration until a

Strategy v6 Sessions & time
Updated today · AGPL-3.0 GitHub repository of Forven S01512 - Monday Drift

This overlay strategy offers two selectable entry modes: a Bollinger squeeze on typical price and a simple moving-average cross. It filters trades by weekday, session, date range, and an optional news window, and can restrict direction or invert the side. Risk

Strategy v5 Volatility & bandsMoving averages
Updated today · None stated GitHub repository of Boilerplate Configurable Strategy [Yosiet]
257 stars

Donald - Test Logic Futures is an overlay strategy designed for intraday futures trading. It combines kernel regression functions with exponential moving averages to evaluate price retracements and entry timing. Trades are filtered by session execution windows

Strategy v5 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Donald - Test Logic Futures

Daily Bias + FVG Strategy

by TradersPost
218 stars

This overlay strategy plots previous-day high and low, the daily open, and fair value gap zones on the price chart. It takes entries on a selectable timeframe when the FVG requirement and an optional session window allow them, then uses an ATR or fixed pip sto

Strategy v6 SMC / ICT / price actionSupport & resistance Repaints
Updated 3 months ago · None stated GitHub repository of Daily Bias + FVG Strategy
106 stars

This script monitors opening gap conditions and breakout behavior relative to the first candle's range across up to twenty configurable stock tickers. It detects whether following bars remain inside the opening range before breaking out, displaying the status

Strategy v4 Screeners & dashboardsBreakout Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 1St Bar GAP+BkOut Screener v2 by RM
53 stars

This strategy enters long or short on the price chart when price is on the correct side of a 200-period EMA, MACD agrees, RSI is not at the opposing extreme, ADX exceeds a threshold, volume beats a 20-bar average, and close breaks the recent high or low. A tim

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · MPL-2.0 GitHub repository of BTCUSD 5M Optimized Strategy

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers