Diagnostics · input.*

input.enum has no known Pyne parameter type

This page is about one diagnostic message, reproduced exactly as the Pine2Py converter prints it. If you have seen this line in your own conversion, here is what it means and the one-line fix that resolves it — verified by running the fixed script.

The diagnostic

Run this five-line script through the converter:

input_enum.pinePine Script v5
//@version=5
indicator("Enum input demo", overlay=false)
mode = input.enum("fast", "Mode", options=["fast", "slow"])
rsi = ta.rsi(close, 14)
plot(mode == "fast" ? rsi : ta.sma(close, 20), "Out")

The converter emits Python, and reports one diagnostic:

unsupported constructs (1):
  - input.enum has no known Pyne parameter type (line 3)

What it means: input.enum declares a dropdown whose value is one of a fixed set of strings, but the converter cannot map it to a typed PyneCore input parameter — there is no input.enum in the Python runtime's input family. The emitted code still contains the input.enum(...) call, so the output is not silently rewritten; it is flagged, and the flag tells you exactly where. A converter that silently fell back to a default value would not be honest here — this one tells you, in one line, with the line number. Here is the emitted Python, verbatim:

input_enum.pyPython · PyneCore
"""
@pyne
"""

from pynecore import Series
from pynecore.lib import close, input, plot, script, ta

@script.indicator(title="Enum input demo", overlay=False)
def main():
    mode: Series[float] = input.enum("fast", "Mode", options=["fast", "slow"])
    rsi: Series[float] = ta.rsi(close, 14)
    plot((rsi if (mode == "fast") else ta.sma(close, 20)), "Out")

The fix: use input.string with the same options

input.enum and input.string with options=[...] are the same dropdown in TradingView: a string input restricted to a fixed set. Replace the call and nothing else changes — the comparison mode == "fast" works identically:

input_enum_fix.pinePine Script v5
//@version=5
indicator("Enum input demo (fixed)", overlay=false)
mode = input.string("fast", "Mode", options=["fast", "slow"])
rsi = ta.rsi(close, 14)
plot(mode == "fast" ? rsi : ta.sma(close, 20), "Out")

The fixed script converts with zero diagnostics:

input_enum_fix.pyPython · PyneCore
"""
@pyne
"""

from pynecore import Series
from pynecore.lib import close, input, plot, script, ta

_pyne_in_mode: str = input.string("fast", "Mode", options=["fast", "slow"])

@script.indicator(title="Enum input demo (fixed)", overlay=False)
def main():
    rsi: Series[float] = ta.rsi(close, 14)
    plot((rsi if (_pyne_in_mode == "fast") else ta.sma(close, 20)), "Out")

Verified: the fix runs

We ran the fixed script on 4,089 bars of CSI 300 daily data (2010-01-04 to 2026-11-06). The Out plot has 4,075 non-missing values out of 4,089 — exactly the RSI warm-up count (4,089 − 14), because the default mode is "fast" and the plot is the RSI. The last value is 37.64, matching an independent pandas Wilder RSI(14) on the same feed. The fix changes the input declaration, not the strategy.

This diagnostic is one of 55 in our 1,909-script sweep (baseline 2026-10-24, in our testing), where 8 were input.* edge cases — 3 × input.enum with no known type, and 5 × non-top-level input.* calls in a single test-framework script. The full sweep is in our tutorial series: I Ran 1,909 Real Pine Scripts Through a Translator.

Try it on your own script

Paste this Pine script — or your own — into the converter on the home page and compare the output. Every account gets 3 free conversions, no card required; Pro is $12/month via Paddle for unlimited conversions.

The output runs on the open-source PyneCore runtime. We ship a patched runtime build for the two constructs stock PyneCore doesn't handle yet — details are on the home page. Pine2Py translates code; it does not provide investment advice, and no backtest result on this page is a promise about any strategy's future performance.