You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
request.currency_rate is rejected even in a branch that can never run #228
Any reference to request.currency_rate fails analysis, even when it sits in a branch whose condition is a literal true. Scripts written for several markets often keep a conversion branch for non-USD symbols; today the whole script cannot be translated, even when backtested on a USD-quoted symbol where the branch is never taken.
ANALYZER 3:42 request.currency_rate(...) is not supported.
Request
Either support request.currency_rate (daily rate feed supplied by the host, like other request.* data), or translate it to a run-time error raised only if the call is actually evaluated, so scripts that never take that branch can run.
That rule is static, though: a branch that is never taken but feeds a quantity would still be refused. For that case, lowering the call to something that raises the run's error only when it is actually evaluated, as runtime.error() does (codegen/visit_call.py#L2368-L2373), would give the behaviour the issue asks for.
Real support needs a rate feed from the host, which is your design call.
Thank you for the report. Confirmed in the v1.7.0 source: any reference to request.currency_rate is rejected at analysis time, even in a branch that can never run. This is not fixed in v1.7.0. We are not adding a currency-rate data feed in this change. The planned change is the second option you suggested: translate the call so that it raises a run-time error only if the call is actually evaluated, so scripts that never take that branch can run. We expect to open the pull request on 2026-10-27.
Verified on main (11b5ca5, with engine 1.6.1): the reproduction with request.currency_rate in a branch that never runs now translates and runs. Thank you for the fix.
Activity
letiep97 commentedon Oct 20, 2026
Still reproduces on main (
aebad8c). A pointer in case it helps:request.currency_rateis listed inHARD_REJECT_FUNC(support_checker.py#L164), so any reference fails whether or not it can run.NO_DATA_REQUEST_FUNC, support_checker.py#L152-L158, andNO_DATA_REQUEST_FUNCS, external_requests.py#L121) would cover uses that only reach display or alerts.runtime.error()does (codegen/visit_call.py#L2368-L2373), would give the behaviour the issue asks for.Real support needs a rate feed from the host, which is your design call.
luisleo526 commentedon Oct 25, 2026
Thank you for the report. Confirmed in the v1.7.0 source: any reference to
request.currency_rateis rejected at analysis time, even in a branch that can never run. This is not fixed in v1.7.0. We are not adding a currency-rate data feed in this change. The planned change is the second option you suggested: translate the call so that it raises a run-time error only if the call is actually evaluated, so scripts that never take that branch can run. We expect to open the pull request on 2026-10-27.letiep97 commentedon Oct 28, 2026
Verified on main (
11b5ca5, with engine 1.6.1): the reproduction withrequest.currency_ratein a branch that never runs now translates and runs. Thank you for the fix.