Skip to content

round 7: bare ta.vwap is the VWAP of hlc3; one TA site per read, evaluator-local inside request.security - #122

Merged
luisleo526 merged 2 commits into
mainfrom
round7/candidate
Sep 5, 2026
Merged

round 7: bare ta.vwap is the VWAP of hlc3; one TA site per read, evaluator-local inside request.security#122
luisleo526 merged 2 commits into
mainfrom
round7/candidate

Conversation

@luisleo526

Copy link
Copy Markdown
Contributor

Round-7 codegen candidate 60b1857, gated PASS together with engine f68baed (composite; pr-gate verdict verdict-f68baed9392d-60b18571d966-af72fb6d0479, hard 0 regressions, target +10/−0).

Pinned on TradingView (NYSE:F 1D tape, 42/42): the bare ta.vwap property is the VWAP of hlc3, not close; a bare ta.vwap read inside request.security is the evaluator's own member, not the chart's. A script's own vwap variable is never the property.

Tests: pytest green (tests/test_vwap_property_source.py + updated).

🤖 Generated with Claude Code

https://claude.ai/code/session_017CWQz8VbJfNdTBt3DYkk3p

luisleo526 and others added 2 commits September 5, 2026 15:55
…e per read -- inside request.security it is the evaluator's own member, not the chart's (round 7, r7-ltf-lookahead)

Pine v6 defines the ``ta.vwap`` variable as the volume-weighted average of
hlc3; the generated code fed the bar's CLOSE to it, on the chart
(visit_expr.py bare-property emission) and in the historical precalculation
loop and every request.security() context (the analyzer's default source
for the synthetic no-arg call). TradingView's own read equals hlc3 on a
daily bar (lab tv notrade-session-vwap-f1d, NYSE:F 1D 2025-07-01..08-31,
42/42 bars, 2026-09-05, ledger 2026-09-05 05:49) where the engine read the
close: on therealbouga-apex-mtf-index-model F@1D ``close < vwap`` /
``close > vwap`` can never hold against the bar's own close, 0 engine
trades vs TV's 9 on every candidate since round 5 (spark trace
2026-09-05: vwap == close on every daily bar, bias / inSession / volOk /
ema all as TV's on the 07-16 signal bar).

And the property read was not bound to its own site: the analyzer keyed
the synthetic call-site on a FuncCall node nobody else held, so the codegen
resolved every bare ``ta.vwap`` to the FIRST live ``_ta_vwap_`` member.
Inside request.security() that is the CHART's member, lowered with
``history_advances_new_bar()`` and advanced by the chart bar and by every
requested sub-bar (nightowlxtrader-azt F@1D: ``vwap5 = request.security(
tickerid, timeframe.period, ta.vwap)`` and vwap15 shared the chart's
``_ta_vwap_1``); a second top-level read shared the first read's member.

Now the site is keyed on the MemberAccess node it came from: the chart
emission binds a read to its own site first (the first-live-site scan
remains the fallback), and a bare ``ta.vwap`` inside request.security() is
that evaluator's ``_sec<id>__ta_vwap_<n>`` member, advanced by
security_series_slot_is_new and fed the requested bar's hlc3, exactly as
the explicit ``ta.vwap(hlc3)`` form already was. The default source of the
synthetic call is ``hlc3`` (an Identifier, so every emission path lowers
it as it lowers the explicit form). ``ta.vwap(source)``, the bands form
and the symbol-clock anchor tail are untouched.

tests/test_vwap_property_source.py: hlc3 on the chart read and the precalc
loop, property == explicit hlc3 call, two reads are two sites each advanced
once, the security-context read binds to its own member (no chart member,
no chart tick rule, no current_bar_) in the "D" and the timeframe.period
shapes. test_anchor_vwap.py / test_vwap_tuple_unpack.py updated from close
to hlc3. Full suite green.

Expected to move: therealbouga-apex-mtf-index-model F@1D and
nightowlxtrader-azt F@1D (with the engine's round-7 branch), and every
probe reading the bare ``ta.vwap`` on an intraday lane -- to be measured
by experiment before any gate.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R6to1XhgQe3S2QsE9Fhq1M
… (round 7, r7-ltf-lookahead)

Guard for ea90029: van007trader-vwap-deviation-score-dyna computes ``float
vwap = sumV > 0 ? sumPV / sumV : na`` from its session accumulators and
reads ``close - vwap``; the property rule (hlc3, own site) must not touch
it -- ea90029 emits byte-identical C++ for the script (2026-09-05), and its
round-7 engine-c regression (100 -> 52.5 on ETH) was the engine's
ta.crossover na handling (pineforge-engine 48993dc), not this codegen.
No codegen change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016oh2BTrHLUSbV1C5JCmrn4
@luisleo526
luisleo526 merged commit 65e7fd0 into main Sep 5, 2026
9 checks passed
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