Skip to content

Enforce strict count parity and fix Pine semantics gaps#60

Merged
luisleo526 merged 7 commits into
mainfrom
campaign/strict-parity-fixes
Jul 4, 2026
Merged

Enforce strict count parity and fix Pine semantics gaps#60
luisleo526 merged 7 commits into
mainfrom
campaign/strict-parity-fixes

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Seven engine fixes from the TV-parity validation campaign:

  • 7427720 Enforce absolute count parity in corpus verifier — excellent now requires count_abs_delta == 0 (percentage count thresholds demoted to display/strong-tier only)
  • b3d2fac Fix equity sizing and POOC re-entry semantics
  • 2ba047e Fix first-valid Pine cross edges
  • c467113 Support Pine bar index offsets
  • a20ac1f Normalize TradingView GMT offsets for timezones
  • 56ab02f Materialize relative exit ticks after entry fills
  • 222eb7d Support unbiased stdev and variance

Gates at HEAD: ctest 78/78 passed; corpus sweep run_corpus.sh ran 252 ok=252 fail=0 (under the new strict verifier: excellent=228, strong=21, moderate=2, anomaly=1 — the stricter gate reclassifies, it does not regress runtime).

🤖 Generated with Claude Code

Bugs solved:
- Honor the Pine ta.stdev/ta.variance biased argument.
- Use sample denominator length - 1 for biased=false and preserve the default biased denominator.

Validation:
- cmake --build build -j4
- ctest --test-dir build -R test_ta_indicators_extras --output-on-failure
- scripts/verify_corpus.py --all --quiet
Store strategy.exit profit/loss tick offsets on pending exits and materialize their limit/stop prices from the live position entry price. This lets retained brackets attached to pending entries fill on the same bar as the entry, matching TradingView TP/SL behavior without strategy-specific logic.
TradingView fixed-offset labels such as GMT+1 use the human-readable sign convention, while POSIX TZ uses the reverse sign. This caused session/time gates to fire in the wrong UTC window for strategies using explicit GMT/UTC offsets.\n\nAdd a shared timezone normalizer, route ScopedTimezone through it, expose it for generated code, and cover session and calendar bucket behavior.
Add a syminfo metadata bar_index_offset for validation feeds whose local OHLCV starts after TradingView's hidden chart-history origin.

Expose pine_bar_index() and pine_last_bar_index() helpers so codegen can shift Pine-visible indices while engine internals remain zero-based.
@luisleo526 luisleo526 merged commit ae4fe48 into main Jul 4, 2026
5 checks passed
@luisleo526 luisleo526 deleted the campaign/strict-parity-fixes branch July 4, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant