Enforce strict count parity and fix Pine semantics gaps#60
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seven engine fixes from the TV-parity validation campaign:
7427720Enforce absolute count parity in corpus verifier —excellentnow requirescount_abs_delta == 0(percentage count thresholds demoted to display/strong-tier only)b3d2facFix equity sizing and POOC re-entry semantics2ba047eFix first-valid Pine cross edgesc467113Support Pine bar index offsetsa20ac1fNormalize TradingView GMT offsets for timezones56ab02fMaterialize relative exit ticks after entry fills222eb7dSupport unbiased stdev and varianceGates at HEAD:
ctest78/78 passed; corpus sweeprun_corpus.shran 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