feat(security): LTF input-passthrough when req >= input AND req < script_tf#4
Merged
Conversation
request.security_lower_tf previously rejected requests where the requested TF was coarser than the chart's input TF, even when finer than the script TF. Pine semantics require returning the real underlying input bars in that range (raw when req == input_tf, OHLCV-rolled when input_tf < req < script_tf). Adds lower_tf_use_input + lower_tf_input_aggregation_ratio to SecurityEvalState, accepts the case in validate_security_timeframes (with divisor checks against both input and script TF), and dispatches one evaluate_security per resulting LTF bar from feed_security_eval_state's per-state input buffer.
Five cases driving the new path: req == input (raw passthrough), req between input and script (aggregated), req == script (rejected), req < input (synthesis fallthrough), req not divisor of script (rejected).
4 tasks
luisleo526
added a commit
that referenced
this pull request
May 11, 2026
…le by req The LTF input-passthrough path added in PR #4 already gated requested-TF > script-TF and script-TF % requested != 0, but the diagnostic wording ("is not finer than" / "is not an integer divisor") was inconsistent with the rest of the validate_security_timeframes() error matrix and read awkwardly to consumers. Rephrase to imperative form ("must be finer than" / "must evenly divide") so the surface text matches what the probe corpus and downstream tooling assert against, and so a caller reading the error knows what to FIX rather than just what WENT WRONG. The control-flow checks themselves are unchanged. Update the existing test_security_lower_tf_input_passthrough assertions to match the new wording.
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.
Summary
Test plan